I'm using Magento version 2.2.0 to create a custom email template for my custom extension, I need to add inline CSS to the email template, I've followed the instruction here , so my email template file look like this:

<!--@subject Custom E-mail  @-->
<!--@vars {
"var this.getUrl($store, 'admin')":"Warehouse Account URL",
"var customer.email":"Customer Email",
"var customer.name":"Customer Name"
} @-->

{{template config_path="design/email/header_template"}} <!-- pathe of template header-->

{{inlinecss file="css/email-inline.css"}}

    <tr class="email-intro">
            <p class="greeting"> {{trans 'Dear %dear,' dear=$dear |raw}} </p>
    <tr class="email-summary">
            <p> {{var message |raw}} </p>
    <tr class="email-information">
            {{var content |raw}}

{{template config_path="design/email/footer_template"}} <!--footer of template-->

My file location for CSS code


2 Answers 2


You can get more idea by following below link.


Also, do the below commands.

php bin/magento setup:static-content:deploy -f 
php bin/magento setup:upgrade
php bin/magento cache:flush 

I am not sure if this step you done or not. But Please run these commands:

php bin/magento setup:static-content:deploy -f 
php bin/magento indexer:reindex 
php bin/magento cache:flush 
php bin/magento cache:clean

I think file is no loaded because of static content was not deployed.

Hope this will help you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.