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 = "[email protected]",
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();
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
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
Did you get this sorted out yet yourself? I'm thinking of using NS and I need to be able to do this.
Yes, i sorted it out. Here is how i did it
is working on a reply...