You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Email templates are stored in the `app/code/<Namespace>/<Module>/view/<area>/email/` directory of their respective modules. For example, the template for the new order tranactional email for the Sales module is located in <ahref="{{ site.mage2000url }}app/code/Magento/Sales/view/email/order_new.html"target="_blank">app/code/Magento/Sales/view/email/order_new.html</a>.
35
+
Email templates are stored in the `app/code/<VendorName>/<ModuleName>/view/<area>/email/` directory of their respective modules. For example, the template for the new order tranactional email for the Sales module is located in <ahref="{{ site.mage2000url }}app/code/Magento/Sales/view/email/order_new.html"target="_blank">app/code/Magento/Sales/view/email/order_new.html</a>.
36
36
37
+
We strongly recommend you not change the default Magento files. If you want to customize the default templats, you should create your custom templates and configure Magento to use them instead the default templates.
37
38
38
-
We strongly recommend not to change the default Magento files. If you want to customize the default templats, you should create your custom templates and configure Magento to use them instead the default templates.
39
-
You can add custom templates as physical files in the file system, or create them using the Magento Admin Panel. Both approaches are described in the following sections.
39
+
You can add custom templates as physical files in the file system, or create them using the Magento Admin. Both approaches are described in the following sections.
40
40
41
41
<h3id="customize-email-theme">Customize email templates using a theme</h3>
42
-
Override email templates by creating templates in your custom theme's `<Vendor>_<Module>/email/` directory. For example, to override the New Order email template, create a `order_new.html` template in `app/design/frontend/<Your_Vendor>/<your_theme>/Magento_Sales/email` directory.
42
+
Override email templates by creating templates in your custom theme's `<VendorName>_<ModuleName>/email/` directory. For example, to override the New Order email template, create a `order_new.html` template in `app/design/frontend/<Your_Vendor>/<your_theme>/Magento_Sales/email` directory.
43
43
44
44
<ahref="{{site.gdeurl}}frontend-dev-guide/themes/theme-inherit.html#theme-inherit-templates"target="_blank">Templates fallback</a> is supported for email templates, so parent themes of your current theme are searched for templates.
45
45
@@ -48,8 +48,9 @@ Override email templates by creating templates in your custom theme's `<Vendor>_
48
48
Any templates configured in the Magento Admin take precedence over default or theme-based templates.
49
49
50
50
1. In the Magento Admin, navigate to **MARKETING** > Communications > **Email Templates**
51
-
2. Click the **Add New Template** button.
52
-
3. If you want to use a default template as a starting point, in the **Load default template** section, choose the template and click the **Load Template** button. The path to the configuration settings for each default template appears in the **Currently Used For** field in the Template Information section. Make note of this path, because you will need it later when you configure this new template to be used instead of the default template.
51
+
2. Click **Add New Template**.
52
+
3. If you want to use a default template as a starting point, in the **Load default template** section, choose the template and click the **Load Template** button. The path to the configuration settings for each default template displays in the **Currently Used For** field in the Template Information section.<br>
53
+
Make note of this path because you will need it later when you configure this new template to be used instead of the default template.
53
54
<br><imgsrc="{{site.baseurl}}common/images/email_create_template.png"alt="New template creation page with loaded default template"width="70%"height="70%"/>
54
55
55
56
4. In **Template Name**, enter a name to identify the template in the Magento Admin.
@@ -58,29 +59,33 @@ Any templates configured in the Magento Admin take precedence over default or th
58
59
7. In **Template Styles**, optionally add CSS styles for the template. These styles are added inside of a `<style>` tag in the `<head>` of the email. Typically you'll use the <ahref="#email-styles">LESS files</a> to make style changes to emails because some email clients don't support styles in `<style>` tags.
59
60
8. Click **Save Template**.
60
61
9. Now that you have created a template, you must configure that template to be used:
61
-
1. Go to **Stores** > **Configuration**
62
-
2. Navigate to the section that contains the template that you want to override. This is the section referenced by the **Currently Used For**. For example, if you created a "New Order" template, the configuration section is **Stores** > **Configuration** > SALES > **Sales Emails**.
63
-
3. Select your newly created template from the dropdown.
62
+
63
+
1. Log in to the Magento Admin as an administrator.
2. In the left pane, locate the section that contains the template you want to override. This is the section referenced by **Currently Used For** in your new template. (See step 3 earlier in this section.)
66
+
67
+
<br>For example, if you created a "New Order" template, the configuration section is **Order** as the following figure shows.
68
+
<br><imgsrc="{{site.baseurl}}common/images/email_choose-template.png"alt="Choosing a custom template"width="70%"height="70%"/>
69
+
70
+
3. Select your newly created template from the list.
64
71
4. Click **Save Config**.
65
72
66
73
<h3id="customize-header-footer">Customize header and footer templates</h3>
67
-
68
-
Every frontend email template includes a header and footer template using these two directives: `{% raw %}{{template config_path="design/email/header_template"}}{% endraw %}` and `{% raw %}{{template config_path="design/email/footer_template"}}{% endraw %}`. By default, those two directives load contents from these files:
74
+
Every email template includes a header and footer template using these two directives: `{% raw %}{{template config_path="design/email/header_template"}}{% endraw %}` and `{% raw %}{{template config_path="design/email/footer_template"}}{% endraw %}`. By default, those two directives load contents from these files:
You can customize header and footer templates using either the <ahref="#customize-email-theme">theme</a> or <ahref="#customize-email-admin">admin</a> customization methods discussed previously.
To add the store and sales related information to a template, use system variables.
78
83
79
-
System variables are placeholders which are replaced by particular values when the actual email is generated. For example, the `{% raw %}{{var store_hours}}{% endraw %}` variable is replaced by the value set in the **Stores** > **Configuration** > GENERAL > **General** > **Emails** section.
84
+
System variables are placeholders which are replaced by particular values when the actual email is generated. For example, the `{% raw %}{{var store_hours}}{% endraw %}` variable is replaced by the value set in the **STORES** > Settings > **Configuration** > GENERAL > **General** > **Emails** section.
80
85
81
86
<divclass="bs-callout bs-callout-info"id="info">
82
87
<spanclass="glyphicon-class">
83
-
<p>You can also create your own custom variables and set their values in the Admin, under <b>System</b> > <b>Custom Variables</b>.</p></span>
88
+
<p>You can also create your own custom variables and set their values in the Admin, under <strong>SYSTEM</strong> > <b>Custom Variables</b>.</p></span>
84
89
</div>
85
90
86
91
To add a variable to your template content:
@@ -95,7 +100,7 @@ To add a variable to your template content:
95
100
96
101
<divclass="bs-callout bs-callout-info"id="info">
97
102
<spanclass="glyphicon-class">
98
-
<p>The selection of available variables depends on which template you use as a basis. Alternatively, you can manually insert variables "related" to other templates in your template code if you know the variable code. </p></span>
103
+
<p>The selection of available variables depends on which template you use as a basis. The template-specific variables are contained in a <code><!--@vars @--></code> comment at the top of each template on the file system. (For example, look at <ahref="{{ site.mage2000url }}app/code/Magento/Customer/view/frontend/email/account_new.html">app/code/Magento/Customer/view/frontend/email/account_new.html</a>.</p></span>
99
104
</div>
100
105
101
106
<h2id="email-styles">Styles for email templates</h2>
@@ -235,20 +240,21 @@ The styles for emails are split into several different files.
235
240
When implementing a custom theme, you should be able to fully customize email templates by copying the `app/design/frontend/Magento/blank/web/css/source/_email-extend.less` and `app/design/frontend/Magento/blank/web/css/source/_email-variables.less` files to your custom theme and editing those files.
236
241
237
242
<h3id="custom-fonts">Custom fonts</h3>
238
-
239
-
Emails will inherit the custom fonts that are defined by the frontend theme. The Magento Blank theme uses the **Open Sans** font. Since **Open Sans** is not a standard system font, `@font-face` rules are used to include web fonts.
243
+
Emails inherit the custom fonts that are defined by the frontend theme. The Magento blank theme uses the **Open Sans** font. Because **Open Sans** is not a standard system font, `@font-face` rules are used to include web fonts.
240
244
241
245
Here is an overview of how the font structure for emails works:
242
246
243
-
* The `app/design/frontend/Magento/blank/web/css/source/_email-extend.less` file contains the `@import` directive which requests the `email-fonts.css` file. The reason the contents of `email-fonts.css` are being loaded using `@import` rather than be output directly into a `<style>` tag in the `<head>` of an email is that if a user is reading their email offline, some email clients won't render the text since the web fonts can't be loaded.
247
+
* <ahref="{{ site.mage2000url }}app/design/frontend/Magento/blank/web/css/source/_email-extend.less"target="_blank">app/design/frontend/Magento/blank/web/css/source/_email-extend.less</a> contains the `@import` directive that requests the `email-fonts.css` file.
248
+
249
+
The reason the contents of `email-fonts.css` are loaded using `@import` rather than being output directly into a `<style>` tag in the `<head>` of an email is that if a user is reading their email offline, some email clients don't render the text because the web fonts can't be loaded.
244
250
* The `app/design/frontend/Magento/blank/web/css/email-fonts.less` file imports `source/_variables.less` and `source/_typography.less` files:
245
-
*The `app/design/frontend/Magento/blank/web/css/source/_variables.less` file defines which font is going to be used, via the `@font-family-name__base` variable.
246
-
*The `app/design/frontend/Magento/blank/web/css/source/_typography.less` file generates the `@font-face` rules which import the custom fonts.
251
+
*<ahref="{{ site.mage2000url }}app/design/frontend/Magento/blank/web/css/source/_variables.less"target="_blank">app/design/frontend/Magento/blank/web/css/source/_variables.less</a> defines which font is used in the `@font-family-name__base` variable.
252
+
*<ahref="{{ site.mage2000url }}app/design/frontend/Magento/blank/web/css/source/_typography.less"target="_blank">app/design/frontend/Magento/blank/web/css/source/_typography.less</a> generates the `@font-face` rules which import the custom fonts.
247
253
248
254
If you want to change the font used for emails, do the following:
249
255
250
256
1. Refer to the documentation on [using fonts]({{ site.gdeurl }}frontend-dev-guide/css-topics/using-fonts.html) for details on how to add a new font.
251
-
2.Once you've added a new font and have updated the `source/_variables.less` and `source/_typography.less` files for your custom theme to refer to the new font, the emails should start using the new font.
257
+
2.After you've added a new font and have updated the `source/_variables.less` and `source/_typography.less` files for your custom theme to refer to the new font, the emails should use the specified font.
252
258
253
259
<h2id="email-logo">Email logo</h2>
254
260
@@ -287,7 +293,7 @@ To customize your logo using a theme:
287
293
288
294
<h3id="customize-logo-admin">Customize the email logo using the Admin</h3>
289
295
290
-
1. In the Magento Admin, navigate to **Stores** > **Configuration** > GENERAL > **Design** > **Emails**
296
+
1. In the Magento Admin, navigate to **STORES** > Settings > **Configuration** > GENERAL > **Design** > **Emails**
291
297
2. In the **Scope** drop-down list, select the scope for which you want to set a logo (a certain store view, the whole website, or default config).
292
298
3. Upload your logo and specify the alternative text for it.
0 commit comments