All threads / s3 images not showing up in gmail?

Ask A Question

Notifications

You’re not receiving notifications from this thread.

s3 images not showing up in gmail?

Jason Ormes asked in Rails
So I'm sending an email using actionmailer which has an image-tag for an image that is stored out in S3.  For some reason gmail doesn't display the image.  it displays images that are coming from the application server.  outlook.com and thunderbird seem to be displaying the S3 images correctly.

Anyone have any thoughts.

Jason

I have experienced this problem as well and it was solved with the following:

  • Including the scheme in the src url (using "//" does not work - use full scheme EG: "https://")
  • Including width and height attributes
  • Including style="display:block" attribute
  • Including both alt and title attributes

For example:

<img src="https://static.mydomain.com/images/logo.png" alt="Logo" title="Logo" style="display:block" width="200" height="87" />
Thank you for the reply, thats what it turned out to be.  Seems gmail doesn't like protocol relative urls.
Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 33,399+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.