04.07.2019 Views

frontend-developer-1

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Customize the Look and Feel of Specific Magento Pages<br />

emails? How do you access properties of variable objects (for<br />

example, var order.getCustomer.getName)?<br />

Custom transactional email templates are configured in Marketing > Email<br />

Templates. These extend or inherit an existing email template. See here for a<br />

simplified lesson on creating a new transactional email template.<br />

Once you have created a new transactional email template, you need to instruct<br />

Magento which email template to use. This is done in Store > Configuration. For<br />

order emails, go to Sales > Sales Emails. For customer emails, go to Customer ><br />

Customer Configuration.<br />

Transactional email templates use the same directives as was discussed in 8.4.<br />

You can utilize the {{var …}} attribute in these email templates for any variable that<br />

was specified when initializing the email. For example, for the order notification<br />

template, the following variables are available (source):<br />

• order: {{var order.getCustomerEmail}}<br />

• billing: {{var billing.getFirstname}}<br />

• payment_html: {{var payment_html}}, renders the HTML output from<br />

the payment block<br />

• store: {{var store.getName}}<br />

• formattedBillingAddress: {{var formattedBillingAddress}}<br />

• formattedShippingAddress: {{var formattedShippingAddress}}<br />

Additionally, in the above example, the email_order_set_template_vars_<br />

before is dispatched so you can modify the parameters or add more to the list.<br />

Copyright © 2018, SwiftOtter, Inc.<br />

139

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!