Episerver Commerce includes a TemplateService, which allows you to generate email notification texts for your site. The TemplateService uses a provider model (XslTemplateProvider) to let different providers generate the text of custom email. This provider uses XSL to convert an order and an XSL file to a customize formatted message. See Notifications for information about this service and usage examples.
Classes in this topic are available in the Mediachase.Commerce.Engine.Template namespace.
Creating a custom message
Use or modify an existing template to create your own. The templates reference a common XSL document, order-shared.xsl, for common elements, like footer and line item formatting. For information about creating XSL and XslTemplateProvider, see Using the XslCompiledTransform Class on MSDN.
Creating a message in a different language
Create a new folder in your Templates folder. Give the new folder a name that matches the CultureInfo name for the language you want to support with a new message template. Create and save the XSL template in this folder, translated to that language. To use the template, call the TemplateService.Process() method, passing in the name of the template (minus the xsl extension).
Creating a template provider
Providers need to be registered in the web.config file. Use the XslTemplateProvider registration in the web.config file as a guide. Each registration must have a name, type, applicationName, and templateSource path. The provider must inherit from TemplateProvider.
Last updated: Apr 01, 2021