Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jan Molbech 31 posts 76 karma points
    Mar 10, 2016 @ 08:57
    Jan Molbech
    0

    What is template?

    In this post http://support.newsletterstudio.org/customer/portal/questions/1505511-working-with-newsletter-studio-programmatically

    there is a reference to a Template_Id. What is this template? I can't find a reference in the Newsletter studio tables that are created in the DB

  • Jan Molbech 31 posts 76 karma points
    Mar 10, 2016 @ 10:06
    Jan Molbech
    0

    Okay, can see that the newsletter class no longer contains a Template_id field.

    Would it be possible to get a updated walkthrough of how to send a mail programmatically

  • Lars Nielsen 5 posts 85 karma points
    Apr 02, 2016 @ 13:38
    Lars Nielsen
    0

    Did you get this sorted out yet yourself? I'm thinking of using NS and I need to be able to do this.

  • Jan Molbech 31 posts 76 karma points
    Apr 06, 2016 @ 07:07
    Jan Molbech
    1

    Yes, i sorted it out. Here is how i did it

    var newsLetterRepository = new NewsletterRepository();
    
     // Create newsletter
                    var ns = new Newsletter
                    {
                        Name = "Name of mail visible in backoffice",
                        MessageBody = messageMarkup,
                        SubscriptionAlias = "Cyclone_0", // need to contain the unique name of the subscriptionlist. 
                        EmailSubject = "Email subject text",
                        EmailFrom = "test@test.com",
                        SenderName = "Testing",
                        Status = 0,//0=Created, 1=Initializing, 2=inProgress, 3=error, 4=completed, 5= paused
                        CreatedDate = datetimeNow, // Setting the date to now so it will be send right away
                        ScheduledSendDate = datetimeNow,
                        CreatedByUserId = 0,
                        SkinAlias = "Default"
                    };
                    newsLetterRepository.Save(ns);
    
    //Calling newsletter endpoint to invoke newsletter sendout method
                    var rootDomain = HttpContext.Current.Request.Url.Host;
                    var newsletterEndpoint = "http://"+rootDomain + "/App_Plugins/NewsletterStudio/Pages/NewsletterCheckForScheduledSendOut.aspx";
                    WebRequest webRequest = WebRequest.Create(newsletterEndpoint);
                    webRequest.Method = "GET";
                    webRequest.GetResponse();
    
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies