0

I have been tasked with creating a simple mail tool that sends emails to internal teams within our company. I have gone through the exercise of creating an email template and using NodeJS, with the nodemailer library to create a message based on this template and sending the email to a user. However, in trying to add images to the template, the resultant email to the recipient, has the images rewritten to what appears to be a google caching proxy system, i.e.

https://somesystem.some.localtion.io/content/myimage.png

gets rewritten to:

https://ci6.googleusercontent.com/proxy/eXuw8UXTcDdsC03GMBJvrQH1Z-Fbu1blh0cCeAw64q1vfx_C20DTRT-T5FSNJw-3G59tIBb3jmvQIpI9x8O7Us4gyHs3uf01dMytVF-EozUHlr23UGA=s0-d-e1-ft#https://somesystem.some.localtion.io/content/myimage.png

The images do not properly resolve since we use a local cdn in which the google caching / proxy system does not have access to.

Based on the following article, Dynamic Images for email such as countdown clocks (in light of gmail image caching)

I have tried adding to the headers of the message options as so:

{
  "host": this.email_server,
  "port": this.port,
  "headers": {
    "Content-Type": "image/jpeg",
    "Cache-Control": "no-store, no-cache, must-revalidate, max-age=0",
    "Cache-Control": "post-check=0, pre-check=0",
    "Pragma": "no-cache"
  }
}

However the problem still exists.

We also tried base64 encoding the image and including this in the template but it appears google strips this out.

Unfortunately due to proprietary images and other business reasons, we are unable to make this CDN public so this is not an option. If there are any other suggestions, please let me know.

thxmike
  • 614
  • 1
  • 7
  • 25

1 Answers1

0

Set up an image URL proxy whitelist that tells google not to proxy images served by your CDN.

Gareth
  • 131
  • 2