More in this section

Forums / Developing with Sitefinity / Custom Newsletter sending and events - API question

Custom Newsletter sending and events - API question

4 posts, 0 answered
  1. Panos Klaoudatos
    Panos Klaoudatos avatar
    8 posts
    Registered:
    14 Aug 2012
    17 Jun 2009
    Link to this post
    Hello,

    I created a custom control that load some email addresses from a custom provider and tries to send a newsletter.

    Once I 've selected the email addresses list, I click on a button that actually sends the newsletter
    Telerik.Notifications.Newsletters.NewsletterManager.SendEmail(....params...)
    or even the Telerik.Notifications.Newsletters.NewsletterManager.SendEmailAsync(...params...).

    I need to be shown with the sending process (when Async), and upon completion I need to mark the newsletter as 'sent/failed' rather than still remaining as 'draft', or even show the failed delivery addresses, etc.

    How do I wire up the events of my custom control? Is there an example of how the events for sending a newsletter are used? The documented API works only as a reference...

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    17 Jun 2009
    Link to this post
    Hello Panos Klaoudatos,

    Generally for sending the newsletters we use WebServices. The control that is used is NewsletterSendingProgress which inherits form Composite control. The control requires Newsletter control panel. The statuses are defind in INewsletter - isDraft, isBeingSend etc. By default we use StartSending() whih is protected and you can use DataManager for sending.
    However, if you are going to implement some logic for the backend you should create a custom webservices should be used by your custom control. If you can provider some code of your control witch some description we could see what is the easiest way for this task.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Panos Klaoudatos
    Panos Klaoudatos avatar
    8 posts
    Registered:
    14 Aug 2012
    25 Jun 2009
    Link to this post
    Hi Ivan,

    Here is the file containing some simple custom control for sending a newsletter.

    I want to implement somehow the async methods for sending the newsletter, and upon completion to get the results of the async call (failed recipients, sent correctly, change the status of the newsletter from draft to being send to sent, etc)

    Regards, Panos

  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    30 Jun 2009
    Link to this post
    Hi Panos Klaoudatos,

    I added some logic to the control you sent. The idea is that you should have a PlaceHolder with Update Panel and Timer inside the update panel. On page load you should subscribe for Timer.Tick event. There you are checking the progress of the email. In SendNewsLetter() you should get the SMTP settings, list of all emails and add asyc sending.
    You can gather more information from the code I have attached. You should complete the logic for sending and error messages.

    I hope this helps.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Register for webinar
4 posts, 0 answered