
Images links broken in Gmail
If you are working on an email sending development, and for any reason, you are wondering why the images are bronken when you receive the emails on your gmail account. This is because of the google’s images proxy.
ie:
The reason of that, is that the images are not open to public (mostly this happens on staging or dev environments).
To fix that, you have to open those images to public, or, for development purposes, you can run the following script on your browser console:
1 |
(function(){ while(img = document.evaluate('//img[contains(@src, \'googleusercontent.com\')]', document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue){ var src = img.attributes.src.value; src = src.substr(src.indexOf('#')+1); img.attributes.src.value = src; } })(); |
After that, you will see the images:
Enjoy!