1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / how to send news and events on publication_date to subscriber

how to send news and events on publication_date to subscriber

4 posts, 0 answered
  1. gopalraman gopal
    gopalraman gopal avatar
    52 posts
    Registered:
    03 Dec 2009
    30 Apr 2010
    Link to this post
    Hi

    I need to create a subscription page contains EmailAddress. After the user Subscribed. I need to send a mail to the subscriber's list about the news and events by Publication_Date.

    And i need to unsubscribe also.

    Is there anything posssible?


    Thanks
    G.GopalRaman
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    30 Apr 2010
    Link to this post
    Hi gopalraman gopal,

    You could use Newsletters module which has subscription and unsubscribe form out of the box to create a group of users. Then you could create a scheduled service to send newsletter with the data for events and news by using the newsltetters API or working through UI

    sample code

    var dm = new DataManager();
    IList subscribers = dm.GetSubscribers();
    foreach (Telerik.Newsletters.ISubscriber subscriber in subscribers)
    {
        string[] toList = new string[] { subscriber.Email };
        string body = string.Format("hi,{0}, {1} ,here my body goes", subscriber.FirstName, subscriber.LastName);
        string subject = "here is my subject";
        string senderName = "here is my name";
        string senderAddress = "here is my address";
        NewsletterManager.SendEmail(toList, body, subject, senderName, senderAddress);
    }

    You could also try to use SendEmailsWithDBUpdaingAsync method.


    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. gopalraman gopal
    gopalraman gopal avatar
    52 posts
    Registered:
    03 Dec 2009
    30 Apr 2010
    Link to this post
    Hi

    In this mail you told that  "you could create a scheduled service to send newsletter with the data for events and news by using the newsltetters API or working through UI" it is possible to create a scheduled  to send news and events to the subscriber? If it is possible can you just send the code please.


    Thanks
    G.GopalRaman
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    30 Apr 2010
    Link to this post
    Hello gopalraman gopal,

    You could take a look at Implementing scheduled services in Sitefinity 3.x

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Register for webinar
4 posts, 0 answered