Hi,
First you need to get the shopping cart object based on the
OrderID and the template you are about to display. Once you have done so, you can get the template text and create a
MacroResolver using the
OrderInfoProvider.CreateEmailMacroResolver method. Then, you can simply resolve all macros in the template text. Please take a look at the following code:
ShoppingCartInfo cartObj = ShoppingCartInfoProvider.GetShoppingCartInfoFromOrder(OrderID);
// Get email template
EmailTemplateInfo template = EmailTemplateProvider.GetEmailTemplate("Ecommerce.OrderPaymentNotificationToCustomer", cartObj.SiteName);
// Check template presence
if (template == null)
{
return;
}
string body = URLHelper.MakeLinksAbsolute(template.TemplateText);
// Prepare the macro resolver
MacroResolver resolver = OrderInfoProvider.CreateEmailMacroResolver(cartObj);
string resolvedBody = resolver.ResolveMacros(body);
Best regards,
Michal Legen