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:
/// <summary>
/// Sends order notification to customer.
/// </summary>
/// <param name="cartObj">Shopping cart info object</param>
/// <param name="templateName">Name of the e-mail template which should be used for creating an e-mail</param>
/// <param name="defaultTemplate">Name of the e-mail template which is used if primary template is not specified</param>
/// <param name="defaultSubject">E-mail default subject. It is used if template subject is not specified</param>
/// <param name="toCustomer">True - it is a notification to customer. False - it is a notification to administrator</param>
/// <param name="eventSource">Source of the event which is logged when sending fails</param>
protected virtual void SendEmailNotificationInternal(ShoppingCartInfo cartObj, string templateName, string defaultTemplate, string defaultSubject, bool toCustomer, string eventSource)
{
// Do not send if required data missing
if ((cartObj == null) || (cartObj.Customer == null))
{
return;
}
// Ensure template name
if (string.IsNullOrEmpty(templateName))
{
templateName = defaultTemplate;
}
// Get email template
EmailTemplateInfo template = EmailTemplateProvider.GetEmailTemplate(templateName, cartObj.SiteName);
// Check template presence
if (template == null)
{
// Ensure event source
if (string.IsNullOrEmpty(eventSource))
{
eventSource = "E-mail notification";
}
// Log error
EventLogProvider.LogException(eventSource, "ECOMMERCE", new Exception(string.Format("Email template '{0}' for site '{1}' not found.", templateName, cartObj.SiteName)));
return;
}
// Get order data
OrderInfo oi = GetOrderInfo(cartObj.OrderId);
if (oi != null)
{
string sendFrom = "";
string sendTo = "";
// Notification to customer
if (toCustomer)
{
sendFrom = ECommerceSettings.SendEmailsFrom(cartObj.SiteName);
sendTo = cartObj.Customer.CustomerEmail;
}
// Notification to administrator
else
{
sendFrom = cartObj.Customer.CustomerEmail;
sendTo = ECommerceSettings.SendEmailsTo(cartObj.SiteName);
}
// Get sender address for given template
sendFrom = EmailHelper.GetSender(template, sendFrom);
if (!string.IsNullOrEmpty(sendFrom) && !string.IsNullOrEmpty(sendTo))
{
string body = URLHelper.MakeLinksAbsolute(template.TemplateText);
// Store original shopping cart culture
string origCartCulture = cartObj.ShoppingCartCulture;
// Use default culture
if (!toCustomer || !ECommerceSettings.UseCustomerCultureForEmails(cartObj.SiteName))
{
cartObj.ShoppingCartCulture = CultureHelper.GetDefaultCultureCode(cartObj.SiteName);
}
// Prepare the macro resolver
MacroResolver resolver = CreateEmailMacroResolver(cartObj);
string[,] specialMacros = ShoppingCartInfoProvider.GetShoppingCartResolverSpecialMacros(cartObj);
// Prepare the message
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
{
// Send email
EmailHelper.ResolveMetaFileImages(message, template.TemplateID, EmailTemplateInfo.OBJECT_TYPE, ObjectAttachmentsCategories.TEMPLATE);
EmailSender.SendEmail(cartObj.SiteName, message);
}
catch (Exception ex)
{
try
{
// Ensure event source
if (string.IsNullOrEmpty(eventSource))
{
eventSource = "E-mail notification";
}
EventLogProvider.LogException(eventSource, "ECOMMERCE", ex);
}
catch
{
// Unable to log the event
}
}
finally
{
// Restore shopping cart culture
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..