Class OrderEmailsScheduledTaskAddIn
- Namespace
- Dynamicweb.Ecommerce.Orders.ScheduledTaskAddIns
- Assembly
- Dynamicweb.Ecommerce.dll
Scheduled task that finds orders matching configured criteria and sends emails to the customers of the orders.
[AddInLabel("Order Emails")]
public sealed class OrderEmailsScheduledTaskAddIn : BaseScheduledTaskAddIn, IParameterOptions, IParameterVisibility
- Inheritance
-
OrderEmailsScheduledTaskAddIn
- Implements
- Inherited Members
Remarks
This AddIn queries orders by flow, state and an optional trigger date field, paging through results
and generating email bodies from a configured template. It supports configuring the order type,
flows, states, a date-field trigger with an offset, the email template and subject. For each matched
order the AddIn constructs an OrderEmailViewModel, renders the template,
and sends mail using EmailHandler while recording an email history key. The AddIn implements
IParameterOptions and IParameterVisibility to supply editor options and
conditional parameter visibility in the AddIn configuration UI.
Properties
EmailSubject
[AddInParameterGroup("Email")]
[AddInParameter("EmailSubject")]
[AddInLabel("Email subject")]
[AddInParameterEditor(typeof(TextParameterEditor), "")]
public string EmailSubject { get; set; }
Property Value
EmailTemplate
[AddInParameterGroup("Email")]
[AddInParameter("EmailTemplate")]
[AddInLabel("Email Template")]
[AddInParameterEditor(typeof(TemplateParameterEditor), "Folder=/Templates/eCom/ScheduledTasks/Order;tooltip=Files/Templates/eCom/ScheduledTasks/Order")]
[Required(ErrorMessage = "Email template is required")]
public string? EmailTemplate { get; set; }
Property Value
OrderFlows
[AddInParameterGroup("Orders to notify")]
[AddInParameter("OrderFlows")]
[AddInLabel("Order Flows")]
[AddInParameterEditor(typeof(CheckListParameterEditor), "ReloadOnChange=true,Multiple=true")]
public string OrderFlows { get; set; }
Property Value
OrderStates
[AddInParameterGroup("Orders to notify")]
[AddInParameter("OrderStates")]
[AddInLabel("Order States")]
[AddInParameterEditor(typeof(CheckListParameterEditor), "")]
[Required(ErrorMessage = "OrderStates are required")]
public string OrderStates { get; set; }
Property Value
OrderType
[AddInParameterGroup("Orders to notify")]
[AddInParameter("OrderType")]
[AddInLabel("Order Type")]
[AddInParameterEditor(typeof(DropDownParameterEditor), "required=true;ReloadOnChange=true")]
public OrderType OrderType { get; set; }
Property Value
SendBeforeOffset
[AddInParameterGroup("Email")]
[AddInParameter("SendBeforeOffset")]
[AddInLabel("Days before/after trigger date to send the email")]
[AddInParameterEditor(typeof(IntegerNumberParameterEditor), "tooltip=Number of days before/after the selected trigger date when the email should be sent")]
public int SendBeforeOffset { get; set; }
Property Value
TriggerDateField
[AddInParameterGroup("Email")]
[AddInParameter("TriggerDateField")]
[AddInLabel("Trigger Email based on field")]
[AddInParameterEditor(typeof(DropDownParameterEditor), "")]
public string TriggerDateField { get; set; }
Property Value
Methods
BuildOrderEmailsKey(string, string)
public static string BuildOrderEmailsKey(string emailToAddress, string orderId)
Parameters
Returns
Run()
Runs task add-in
public override bool Run()