cancel
Showing results for 
Search instead for 
Did you mean: 

magento 2.2: email template style class not found

   Did you know you can see the translated content as per your choice?

Translation is in progress. Please check again after few minutes.

magento 2.2: email template style class not found

Can someone help me to find files .css or .less containing class declaration?
Where are they located?

For example where I can find declaration of following class in the template "New order for guest"?:

...

<table class="order-details">
<tr>
<td class="address-details">
<h3>{{trans "Billing Info"}}</h3>
<p>{{var formattedBillingAddress|raw}}</p>
</td>
{{depend order.getIsNotVirtual()}}
<td class="address-details">

...

 

Thanks for help,
Daniele

2 REPLIES 2

Re: magento 2.2: email template style class not found

Hello @webarredamenti

 

  1. 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 LESS files to make style changes to emails because some email clients don’t support styles in <style> tags.

https://devdocs.magento.com/guides/v2.0/frontend-dev-guide/templates/template-email.html

Follow below link to check path of css:

https://devdocs.magento.com/guides/v2.0/frontend-dev-guide/templates/template-email.html#email-style...

Manish Mittal
https://www.manishmittal.com/

Re: magento 2.2: email template style class not found

Hello @webarredamenti,

 

 

You can check the official documentation here : http://devdocs.magento.com/guides/v2.1/frontend-dev-guide/templates/template-email.html

The general steps :

  • Create a Magento 2 frontend theme
  • Upload your custom logo here : app/design/frontend/Vendor/Theme/Magento_Email/web/logo_email.png
  • Edit the header and footer parts here : app/design/frontend/Vendor/Theme/Magento_Email/email/header.html and app/design/frontend/Vendor/Theme/Magento_Email/email/footer.html
  • Edit the sales email templates for example here : app/design/frontend/Vendor/Theme/Magento_Sales/email/order_new.html
  • Add your custom styles here for common emails : app/design/frontend/Vendor/Theme/web/css/source/_email-extend.less
  • Add your custom less variables here for common emails : app/design/frontend/Vendor/Theme/web/css/source/_email-variables.less
  • Add your custom styles here for sales emails : app/design/frontend/Vendor/Theme/Magento_Sales/web/css/source/_email.less

And the final step is to upgrade the Magento 2 Emogrifier library in order to fix bugs with inline css generation.

 

--
If my answer is useful, please Accept as Solution & give Kudos