0

in my case i am using magento 2.2.x , so i want to override the file "vendor/magento/module-email/view/frontend/email/header.html" in order to add a logo in the email to show the company's logo in the customer's mailbox side , but it doesn't work, i can't see the icon for the alt attribute that means the picture is there but still not showing in the header of the mail

i call the image from a custom module Mymodule_Email sequence of Magento_Email

my file inside app/design dir to override : vendor/magento/module-email/view/frontend/email/header.htm:


<table class="wrapper" width="100%">
    <tr>
        <td class="wrapper-inner" align="center">
            <table class="main" align="center">
                <tr>
                    <td class="header">
                        <img src="<?php echo $this->getViewFileUrl('Mymodule_Email::images/logo.png'); ?>"
                        />
                    </td>
                </tr>
                <tr>
                    <td class="main-content">
                        <!-- Begin Content -->

PS : when i use simple syntax it works , for example <img src="https://www.w3schools.com/html/pic_trulli.jpg" />
PS : file structure and path for the image is good : 'Mymodule_Email::images/logo.png'

can anyone help me please ?

1
  • Hey, try to inspect the email image and see if the path that magento it's generating for the image it's correct might give a hint – Rui Silva Oct 1 '20 at 15:39
0

First of all you can't add PHP code in html file.

You can add or change email logo from admin.

Please prefer this link Magento DevDocs for Email Templates

Steps to upload logo from admin is :: Magento Admin > CONTENT > Design > Configuration > Select your store scope > enter image description here > Save Configuration

If this helps you then hit like.

Thank you

Hiren Patel

1
  • Thank you for your response , but i want to do it by code in order to keep changes to different instances , do you have any suggestion? – coding mv Oct 1 '20 at 20:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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