I am custom template for Magento 2
Created two new email template in admin backend
- order confirmation email template
- Shipment notification email template
Both are sharing same header and footer templates.
But when I recieve email order confirmation email showing images properly and shipment notification email images are not proper.
How logo displayed:
Even I checked the email by debuging as html format I got two different image urls
- https://myshopURL/static/version1536201509/frontend/namespace/module_name/en_GB/Magento_Email/logo_email.png (logo url of order confirmation & its correct)
- https://myshopURL/pub/static/version1536201509/frontend/namespace/module_name/en_GB/Magento_Email/logo_email.png (logo url of shipment notification & its incorrect).
the word "pub" added extra in shipment notification email logo URL.
How these logo urls are different they share same header and footer email template?
Am I wrong somewhere?
Best Answer
I had a simular problem. On viewing emails in magento backend, everything was fine. But if i send the email, there was this /pub directory in the url. I added a configuration to my env.php file in the app/etc folder and everything work fine now. I think, the problem was, that our nginx use the pub folder as document root folder. See the magento docs for more information. In this case, i had to set the following node to the array in my environment file: