1

I am getting image in my custom email template but image is not showing in email sent from my localhost. I just need to know why the images are not loading/visible in my email?

  • Where should i put the code to run my image files? – Pranavi More Jul 31 '19 at 12:13
2

It is loaded from the server when the email is opened. My guess is you are sending the email to a Gmail account. When you do that, Google proxies the image to protect your identity by not having your IP hit the Magento server.

Either move the image to a publicly accessible location or setup a staging server to test the whole site on a public server. Since Google can't hit your local server, that image will never load.

| improve this answer | |
  • yes i am using gmail account @krishna. What should i do to display image ? – Ramkishan Suthar Sep 22 '16 at 12:42
  • Url of image is something like this ci5.googleusercontent.com/proxy/… – Ramkishan Suthar Sep 22 '16 at 12:45
  • I guess image has not been loaded on server ? – Ramkishan Suthar Sep 22 '16 at 12:46
  • Yes, Either move the image to a publicly accessible location or setup a staging server to test the whole site on a public server. Since Google can't hit your local server, that image will never load. – Krishna ijjada Sep 22 '16 at 12:48
  • Ok i got it @Krishna. Thank you for your help – Ramkishan Suthar Sep 22 '16 at 12:54
3

A bit late but it can help. To test my email images, i use a JS script that remove Google Proxy Address from the img src :

Open the email in gmail, open a console with inspector, copy/paste this code and run it :

var images = document.querySelectorAll("img");
for(var i=0; i<images.length; i++) {
    console.log(images[i].src);
    images[i].src=images[i].src.replace(/^https:\/\/[a-zA-Z0-9.\/\-=_]+#/,'');
}
| improve this answer | |
  • what is the proper solution ? – Ahsan Horani May 14 '18 at 8:11
  • Now days i am getting such url that actually after replacing whole url also with above script i am not getting theme path in the url anywhere. – Shashank Bhatt Aug 12 at 9:13

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.