Customizing Templates
Learn how to create custom templates for emails, prints, and exports.
Umbraco Commerce provides support for customizing templates for emails, prints, and exports. This allows you to tailor the outputs of your e-commerce solution to meet specific branding or functional requirements.
Accessing the Default Built-in Templates
The default templates for email, print, and export are embedded in Razor Class Libraries (RCLs) in Umbraco Commerce. To customize these templates, you can extract them and use them as a starting point.
Download the custom templates and place them in /Views/Partials/Commerce/Email/
.
Creating Custom Templates
Email Templates
To Create a Custom Email Template:
Create a Razor view file (
.cshtml
) in/Views/Partials/Commerce/Email/.
Implement the
IEmailTemplate
interface to make the template available in Umbraco Commerce:
Register the Template in a Composer:
Print and Export Templates
To create Print/Export Templates:
Create a Razor view file (
.cshtml
) under the relevant paths:
Implement the
IPrintTemplate
orIExportTemplate
interface to make the template available in Umbraco Commerce.Register the template in a Composer similar to the email template process.
Shipping Custom Templates in a Razor Class Library
To distribute custom templates as part of a Razor Class Library (RCL):
Create a new Razor Class Library project.
Add the template files under appropriate paths, for example,
Views/Partials/Commerce/Emails/
.Implement interfaces like
IEmailTemplate,
IPrintTemplate,
orIExportTemplate
.Use a composer to register your custom templates.
Last updated