What is Message Template in Magento 2?
Message Template in Magento 2 is a form of notification message which is specified for each activity or event that activate notification. The progress of changing the content of each message is similar to changing the header of footer email template. There is a difference in message template, every email template is specified for each activity or event that activate a notification. You can use the default message template in Magento 2 or edit them to match your store and brand name. There are much selection of variables that can be attached to a template, in addition to a template text. In this article, we will show you how to customize Message Template in Magento 2 Configuration.
Follow these steps to customize Message Template in Magento 2 Configuration
Step 1: Load the Default Template
- On the Admin sidebar, click Marketing. After that, under Communications, choose Email Templates.
- Click Add New Template. After that, follow these steps:
- In the Template list under Load default template, select the template that you want to customize.
- Click Load Template.
Step 2: Customize the Template
- In the Template Name field, input a name for your custom template.
- Normally, the Template Subject includes the first line of the message, which is the greeting. You can use the default content, or add something else.
- Remember the Currently Used For path to the template configuration. To update the configuration, you have to follow this path later.
- In the Template Content box, edit the HTML as you wished. The content comprises a combination of text, HTML tags, CSS codes, and variables.
Be careful not to override the code that is enclosed in double braces while working in the template code.
- To add a variable, firstly you have to place the cursor in the code where the variable will appear, then click Insert Variable. After that, select the variable you want to add.
A marked up tag for the variable is added to the code after chosen a variable
- Input the CSS styles in the Template Styles box if you want to create any CSS declarations.
Step 3: Update the Configuration
- Find the following information that relates to your templates at the top of the Template Information section
|Create New Account Options
|Default Welcome Email
- To open the template configuration page, click the link.
- Open the section. Find the field for the customized email template that you just edited before, and determine the new template as the default.
Step 4: Preview and Save the Template
- Click Preview Template to preview your customized template, make any changes to your template as needed.
- Click Save Template after you’re done. Now your customer email template is now available in the list of Email templates.
|LOAD DEFAULT TEMPLATE
|The choice of available templates will be listed and recognizes the template to be customized
|The name of your custom template.
|a Store Contact Information variable can be inserted into the template at the cursor location.
|In the Subject column, the Template Subject displayed to sort and filter the templates in the list.
|The HTML content of the template.
|In the Template Styles box, you can enter any CSS style declarations to format the template header.