We use the "EmailSender" from Kentico to send emails from the MVC site. You can then use a Kentico email template's with macro's in it. There is a macro for retrieving the current shopping cart ({% ECommerceContext.CurrentShoppingCart %}
), but I'm not sure if that is working directly in the email template.
Example:
public static void SendMail(string templateName, string recipient, MacroResolver resolver = null)
{
var email = new EmailMessage();
var template = EmailTemplateProvider.GetEmailTemplate(templateName, SiteContext.CurrentSiteID);
if (resolver == null)
{
resolver = MacroResolver.GetInstance();
}
email.EmailFormat = EmailFormatEnum.Both;
email.From = template.TemplateFrom;
email.Recipients = recipient;
email.Subject = template.TemplateSubject;
EmailSender.SendEmailWithTemplateText(SiteContext.CurrentSiteName, email, template, resolver, false);
}
You could also try adding the shopping cart as custom macro resolver data. Like this:
macroResolver.SetNamedSourceData("ShoppingCart", shoppingCart);
Which can be used in the email template:
{% ShoppingCart.ID %}