Hello again, i looked into it a bit further and there is a different exposed method you will need to override to get it in the email notification, it is:
protected virtual void SendEmailNotificationInternal(ShoppingCartInfo cartObj, string templateName, string defaultTemplate, string defaultSubject, bool toCustomer, string eventSource)
{
if ((cartObj == null) || (cartObj.Customer == null))
{
return;
}
if (string.IsNullOrEmpty(templateName))
{
templateName = defaultTemplate;
}
EmailTemplateInfo template = EmailTemplateProvider.GetEmailTemplate(templateName, cartObj.SiteName);
if (template == null)
{
if (string.IsNullOrEmpty(eventSource))
{
eventSource = "E-mail notification";
}
EventLogProvider.LogException(eventSource, "ECOMMERCE", new Exception(string.Format("Email template '{0}' for site '{1}' not found.", templateName, cartObj.SiteName)));
return;
}
OrderInfo oi = GetOrderInfo(cartObj.OrderId);
if (oi != null)
{
string sendFrom = "";
string sendTo = "";
if (toCustomer)
{
sendFrom = ECommerceSettings.SendEmailsFrom(cartObj.SiteName);
sendTo = cartObj.Customer.CustomerEmail;
}
else
{
sendFrom = cartObj.Customer.CustomerEmail;
sendTo = ECommerceSettings.SendEmailsTo(cartObj.SiteName);
}
sendFrom = EmailHelper.GetSender(template, sendFrom);
if (!string.IsNullOrEmpty(sendFrom) && !string.IsNullOrEmpty(sendTo))
{
string body = URLHelper.MakeLinksAbsolute(template.TemplateText);
string origCartCulture = cartObj.ShoppingCartCulture;
if (!toCustomer || !ECommerceSettings.UseCustomerCultureForEmails(cartObj.SiteName))
{
cartObj.ShoppingCartCulture = CultureHelper.GetDefaultCultureCode(cartObj.SiteName);
}
MacroResolver resolver = CreateEmailMacroResolver(cartObj);
string[,] specialMacros = ShoppingCartInfoProvider.GetShoppingCartResolverSpecialMacros(cartObj);
EmailMessage message = new EmailMessage
{
From = sendFrom,
Body = resolver.ResolveMacros(TextHelper.BulkReplace(body, specialMacros)),
Recipients = sendTo,
EmailFormat = EmailFormatEnum.Default
};
defaultSubject = ResHelper.GetString(defaultSubject, cartObj.ShoppingCartCulture);
message.Subject = resolver.ResolveMacros(TextHelper.BulkReplace(EmailHelper.GetSubject(template, defaultSubject), specialMacros));
message.PlainTextBody = resolver.ResolveMacros(TextHelper.BulkReplace(template.TemplatePlainText, specialMacros));
message.CcRecipients = template.TemplateCc;
message.BccRecipients = template.TemplateBcc;
try
{
EmailHelper.ResolveMetaFileImages(message, template.TemplateID, EmailTemplateInfo.OBJECT_TYPE, ObjectAttachmentsCategories.TEMPLATE);
EmailSender.SendEmail(cartObj.SiteName, message);
}
catch (Exception ex)
{
try
{
if (string.IsNullOrEmpty(eventSource))
{
eventSource = "E-mail notification";
}
EventLogProvider.LogException(eventSource, "ECOMMERCE", ex);
}
catch
{
}
}
finally
{
cartObj.ShoppingCartCulture = origCartCulture;
}
}
}
}
So, this time, you will basically check to see if the defaultTemplate is your customer payment notification template and then set the source data here just like before like this:
if(defaultTemplate == "Ecommerce.OrderStatusNotificationToCustomer")
{
resolver.SetNamedSourceData("OrderEventLocation", GetEventLocationHere() );
}
Once you have done this, that macro should render in the email template..