Enhanced Customer Email Templates
Email Fragments
With this release, fragments can be used to customize email templates. Email fragments are FreeMarker template files. They can be global and also be included in email template packages.
- Global fragments can be used in any email template. ZIP files for global fragments have the same structure as for email templates. The default content includes Strings.xlf placeholder for the “en” locale and Readme.txt file that has details about how to use global fragments. Translation resources added with global fragments, can be used in global fragments and in email templates that include them.
- Fragments can be uploaded with any email template package ZIP file along with subject.ftl, html_body.ftl, and text_body.ftl.
The Email Settings page in the Administration Console has a new Global Configuration section that allows downloading and uploading global fragments and translations for them. Global fragments are enabled by default. To download global fragments:
- Click Settings.
- Select Email Settings.
- If you run multiple sites from a single Commerce instance, select the site for which you want to download.
- Click Fragments.
- Under Content, click Download Current Content.
Once you prepared global fragments and translations, compress them into a ZIP file and upload it. The ZIP file should contain the following files:
- locales/<langcode>/Strings.xlf where langcode is a supported locale code that has underscores replaced with hyphens.
- .ftl files organized in folders if required.
To upload global fragments:
- Click Settings.
- Select Email Settings.
- If you run multiple sites from a single Commerce instance, select the site for which you want to download.
- Click Fragments.
- Under Content, click Upload New Content.
- Publish the changes.
Additional Properties on Email Templates
This release introduces support for additional attributes that can be used when constructing email templates for specific emails. The newly added attributes include:
- Total value of Order excluding Tax(totalWithoutTax): Added for order-related email types.
- Dynamic Properties Array(dynamicProperties) for Child Items: Added for order-related email types.
- Last Name(lastName): Added for profile-related email types.
A comprehensive list of all available attributes for each email type can be found in the README file included in the template package for the email type. This package can be downloaded from the Administration Console’s Email Settings section.
These enhancements simplify management of email templates and also allows sending more detailed and informative emails to their customers.
Steps to Enable
You don't need to do anything to enable this feature.
Tips And Considerations
- Fragments can be organized in folders. “config” is a reserved top level folder name.
- Only Strings.xlf files can be added under the “locales” folder.
- Email fragments can be included using absolute and relative paths. Absolute path starts with a slash and notification type id. “fragments” is the notification type id for global fragments. Relative paths don’t have a leading slash. Fragments from other email templates cannot be included.
Examples for absolute paths:
<#include "/fragments/header.ftl">
<#include "/mfa_verification_code_v1/includes/copyright.ftl">
Examples for relative paths:
<#include "header.ftl">
<#include "includes/copyright.ftl">
- If a translation resource with the same key is declared in both global fragments and the email template being processed, the email template version shall take precedence.
- Emails fragments are not validated on uploading.
- Please refer to Customize Email Templates of Extending Oracle Commerce guide for more details.