Tetanal UK Project : TATE-106957
Create a GetOrderApproveMail method on ExtendedOrderConfirmationHelper
protected MailMessage GetOrderApproveMail(string templateName, IOrder order, NameValueCollection additionalReplaceTags = null, IList<MailAddress> recipients = null) { var shopContext = ShopContext.GetCurrent(); var settings = shopContext.Settings; var fromAddress = new MailAddress(settings.FromEmailAddress); var replaceTags = GetReplaceTags(shopContext, order); if (additionalReplaceTags != null) { additionalReplaceTags.AllKeys.Each(tagName => replaceTags.Add(tagName, additionalReplaceTags[tagName])); } var additionalData = new Dictionary<string, object>(); additionalData.Add("OrderDetails", CreateOrderDetailsModel(shopContext, order)); if (recipients == null) { recipients = GetEmailAddresses(shopContext, order); } var mail = ShopApi.Mail.Render(fromAddress, recipients, templateName, replaceTags, additionalData); if (settings.BccEmailAddresses != null) { settings.BccEmailAddresses.Each(bcc => mail.Bcc.Add(new MailAddress(bcc))); } return mail; }
public MailMessage GetOrderApprovalEmail(string templateName, IOrder order, IList<MailAddress> recipients = null) { return GetOrderApproveMail(templateName, order, recipients: recipients); }
1ExtendedOrderConfirmationHelper : create GetOrderApproveMail method
2 ExtendedStoreInfoModel : add field to the settings
eg :((ExtendedWebsiteSettings)settings).OrderApprovalEmails = SplitEmails(this.OrderApprovalEmails);
3 ExtendedConfirmationEmailCheckoutHandler : inside SendMail() > call ExtendedOrderConfirmationHelper.GetOrderApprovalEmail()
4 ExtendedWebsiteSettings add OrderApprovalEmails
5 ExtendedOrderProvider : in save order() > Assign OrdersNeedApproval by condtion
6 mailTemplate : orderneedAproval .chtml