Hi,
I can't find any documentation on how to do anything with the newsletter API, does anyone know how to find such help?
I want to add a user programatically to the newsletter list.
The 2nd Step of eCommerce is to request user information, and I have a checkbox in the template, so that user can be added to the Newsletter list as well the format type.
BasketExtender code below:
public class Diff : Dynamicweb.eCommerce.Orders.OrderTemplateExtender
{
public override void ExtendTemplate(Dynamicweb.Templatev2.Template Template, Dynamicweb.eCommerce.Frontend.TemplateExtenderRenderingState RenderingState)
{
if (RenderingState == Dynamicweb.eCommerce.Frontend.TemplateExtenderRenderingState.Before)
{
if (Order.StateNum == 2)
CustumerTemplate(Template);
}
base.ExtendTemplate(Template, RenderingState);
}
private void CustomerTemplate(Dynamicweb.Templatev2.Template Template)
{
String ID = Base.Request("ID");
if (ID == null) return;
int AreaID = Dynamicweb.Frontend.PageView.Current().AreaID;
String type = Base.Request("type") == null ? null : Base.Request("type");
try
{
String customerName = HttpContext.Current.Request.Form["EcomOrderCustomerName"];
String customerEmail = HttpContext.Current.Request.Form["EcomOrderCustomerEmail"];
String newsSubs = HttpContext.Current.Request.Form["NewsletterSubscription"];
String newsType = HttpContext.Current.Request.Form["MailFormat"];
if (newsSubs.ToLower() == "yes")
{
//Dynamicweb.NewsLetterV3... ?
}
}
catch (Exception)
{
// Do nothing
}
}
}
Thank you.