cancel
Showing results for 
Search instead for 
Did you mean: 

How to edit email preview text for emails in magento 2 when using header template

How to edit email preview text for emails in magento 2 when using header template

I am working on customizing emails in Magento 2 admin panel. I have created a header template and footer template, and have also created other email templates that pull the header and footer from the previously mentioned templates. We have tested the emails, and noticed that the email preview text pulls the words from the header first, then the body of the email. Instead, we want to just show the body of the email as the preview text.

In order to do this, we can add a div with the preview text we want shown, before the header. But, because of the various different email templates, we would want the preview text to be specific for each email template. Since the preview text div needs to be added in the header template, I'm not sure how to customize it so it is different for each email template, when they are all pulling from the same header template.

```
<div style="display:none;font-size:1px;color:#ffffff;line-height:1px;max-height:0px;max-width:0px;opacity:0;overflow:hidden">Hello {{customerFirstname}}, Your claim concerning order {{orderUuid}} for the following item: Item name: {{productTitle}} Item status: {{offerState}} Item price: {{priceUnit}} Quantity: {{quantity}}</div>
```

So, in order to easily change the email header in the future, we need to keep the email header template in place. Is there a way to customize the preview text to show the body text of each email, instead of showing the words from the header?

 

We want the email preview to look like the red example, not including the header text words of "Dairy Protein Dry Goods and Non-Food"We want the email preview to look like the red example, not including the header text words of "Dairy Protein Dry Goods and Non-Food"