Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
EPiServer Commerce includes aTemplateService which allows you to generate e-mail notification texts for your site. The TemplateService uses a provider model to allow different providers to be used to generate the text of custom e-mails. The provider included is calledXslTemplateProvider. This provider uses XSL to convert an order and an XSL file into a custom formatted message. More detailed information about how this service works and examples of how to use it can be found inthe Notifications section.
Classes referred to here are available in the following namespaces:
Use/modify one of the existing templates to create your own. Notice that the templates reference a common XSL document, order-shared.xsl, for common elements, like the footer and line item formatting. For more information on how to create XSL and XslTemplateProvider, referto Using the XslCompiledTransform Class on MSDN.
Create a new folder in your Templates folder with a name that corresponds to the CultureInfo name for the language you are looking 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).
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 fromTemplateProvider.
Last updated: Oct 21, 2014