7

I am custom template for Magento 2 Created two new email template in admin backend

  1. order confirmation email template
  2. 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:

enter image description here

Even I checked the email by debuging as html format I got two different image urls

  1. https://myshopURL/static/version1536201509/frontend/namespace/module_name/en_GB/Magento_Email/logo_email.png (logo url of order confirmation & its correct)
  2. 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?

4
  • 1
    In time when you was creating this templates did you change from developer mode to production? Try clear image cache.
    – BartZalas
    Commented Sep 21, 2018 at 22:11
  • @BartZalas, this is on production only. yes cleared cache.
    – Charlie
    Commented Sep 24, 2018 at 7:55
  • I don't know I think you missed something in cleaning cache, Manually delete I had same issue but I dont remember what helped. Maybe this will help a little magento.stackexchange.com/questions/175455/… Try to change from production to developer and back to production.
    – BartZalas
    Commented Sep 24, 2018 at 9:28
  • @BartZalas, I will try with cache cleaning process and see. Thanks man
    – Charlie
    Commented Sep 24, 2018 at 11:19

1 Answer 1

2

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:

'directories' => [
  'document_root_is_pub' => true,
],

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.