Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Commit cb609ca

Browse files
author
stevjohnson
committed
PR301. Proofreading
1 parent 7dce03c commit cb609ca

2 files changed

Lines changed: 30 additions & 24 deletions

File tree

53.1 KB
Loading

guides/v1.0/frontend-dev-guide/templates/template-email.md

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ This topic covers how to customize the content and design of email templates.
3232
* <a href="#newsletter-templates">Newsletter templates</a>
3333

3434
<h2 id="customize-email-templates">Customize email templates</h2>
35-
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 <a href="{{ 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 <a href="{{ site.mage2000url }}app/code/Magento/Sales/view/email/order_new.html" target="_blank">app/code/Magento/Sales/view/email/order_new.html</a>.
3636

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.
3738

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.
4040

4141
<h3 id="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.
4343

4444
<a href="{{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.
4545

@@ -48,8 +48,9 @@ Override email templates by creating templates in your custom theme's `<Vendor>_
4848
Any templates configured in the Magento Admin take precedence over default or theme-based templates.
4949

5050
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.
5354
<br><img src="{{site.baseurl}}common/images/email_create_template.png" alt="New template creation page with loaded default template" width="70%" height="70%"/>
5455

5556
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
5859
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 <a href="#email-styles">LESS files</a> to make style changes to emails because some email clients don't support styles in `<style>` tags.
5960
8. Click **Save Template**.
6061
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.
64+
1. Click **STORES** > Settings > **Configuration** > SALES > **Sales Emails**.
65+
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><img src="{{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.
6471
4. Click **Save Config**.
6572

6673
<h3 id="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:
6975

7076
* <a href="{{ site.mage2000url }}app/code/Magento/Email/view/email/header.html" target="_blank">app/code/Magento/Email/view/email/header.html</a>
7177
* <a href="{{ site.mage2000url }}app/code/Magento/Email/view/email/footer.html" target="_blank">app/code/Magento/Email/view/email/footer.html</a>
7278

7379
You can customize header and footer templates using either the <a href="#customize-email-theme">theme</a> or <a href="#customize-email-admin">admin</a> customization methods discussed previously.
7480

7581
<h3 id="customize-content">Customize email content</h3>
76-
7782
To add the store and sales related information to a template, use system variables.
7883

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.
8085

8186
<div class="bs-callout bs-callout-info" id="info">
8287
<span class="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>
8489
</div>
8590

8691
To add a variable to your template content:
@@ -95,7 +100,7 @@ To add a variable to your template content:
95100

96101
<div class="bs-callout bs-callout-info" id="info">
97102
<span class="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>&lt;!--@vars @--&gt;</code> comment at the top of each template on the file system. (For example, look at <a href="{{ 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>
99104
</div>
100105

101106
<h2 id="email-styles">Styles for email templates</h2>
@@ -235,20 +240,21 @@ The styles for emails are split into several different files.
235240
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.
236241

237242
<h3 id="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.
240244

241245
Here is an overview of how the font structure for emails works:
242246

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+
* <a href="{{ 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.
244250
* 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+
* <a href="{{ 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+
* <a href="{{ 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.
247253

248254
If you want to change the font used for emails, do the following:
249255

250256
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.
252258

253259
<h2 id="email-logo">Email logo</h2>
254260

@@ -287,7 +293,7 @@ To customize your logo using a theme:
287293

288294
<h3 id="customize-logo-admin">Customize the email logo using the Admin</h3>
289295

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**
291297
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).
292298
3. Upload your logo and specify the alternative text for it.
293299
<img src="{{site.baseurl}}common/images/email_configuration.png" alt="System configuration">
@@ -302,12 +308,12 @@ Emails can output your store name, store email address, store phone number, and
302308
To set those values:
303309

304310
1. To set the store name, phone number, and hours of operation:
305-
1. In the Magento Admin, navigate to **Stores** > **Configuration** > GENERAL > **General** > **Emails**
311+
1. In the Magento Admin, navigate to **STORES** > Settings > **Configuration** > GENERAL > **General** > **Emails**
306312
2. Input values into the **Store Name**, **Store Phone Number**, and **Store Hours of Operation** fields.
307313
3. Note: The **Store Phone Number** and **Store Hours of Operation** fields are optional.
308314
4. Click the **Save Config** button.
309315
2. To set the store name, phone number, and hours of operation:
310-
1. In the Magento Admin, navigate to **Stores** > **Configuration** > GENERAL > **General** > **Store Email Addresses** > **General Contact**
316+
1. In the Magento Admin, navigate to **STORES** > Settings > **Configuration** > GENERAL > **General** > **Store Email Addresses** > **General Contact**
311317
2. Input values into the **Sender Name** and **Sender Email** fields.
312318
3. Click the **Save Config** button.
313319

0 commit comments

Comments
 (0)