The following code exists in Magento 1 to get an image in template syntax, is there a way to do this in Magento 2 and load an image from my theme for the email template? I want to add additional images to the footer.

<div sytle="background: {{skin url="images/myimage.png" _area="frontend" _theme="default" _package="mytheme"}}"></div>  
  • 1
    Where is your image exist ? i mean in which directory ? – Manthan Dave Jul 13 '17 at 8:16
  • I have the answer, I can write my own answer and accept that, or if you want to provide an answer as an example I can accept that? – LM_Fielding Jul 13 '17 at 10:03
  • 1
    Yes can post your own answer and accept that , dats ok – Manthan Dave Jul 13 '17 at 11:06

Code for accessing an image in a theme web/images folder in Magento 2 email template:

     src="{{view url='images/email/youtube.jpg'}}"
     alt="Website Youtube"
| improve this answer | |
  • I know more than six people have used this, it took me a lot of curiosity when I started using the email template syntax. – LM_Fielding Mar 24 '19 at 0:07
  • Where i can find this path: images/email/ – shivashankar m Jul 17 '19 at 13:56
  • I can't remember, but I would guess pub/? – LM_Fielding Jul 24 '19 at 19:34

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.