htmlcssemailtransactional-email

Adding an image to an HTML email


I am looking for the definitive way to add images (like a logo or social media icon) to my HTML email templates. What this means:

Approaches tried so far:

I am able to find very long articles discussing all the pros and cons of a myriad of approaches without telling you the best way to do it. If there are other (better ways) to format transactional emails I am also all ears. Thanks!


Solution

  • I could technically take the angle that it's preference as to which you choose, but I think that adding a hosted image as an <img> is the best approach for this problem - regarding gmail blocking the image from display I'd look into hosting the image on a few different servers and testing each because our company emails have our company logo at the top and it displays perfectly fine through gmail and it's solely a hosted image in an <img> element.

    Let me know how you get along with this - if you find a host that works with gmail you shouldn't see any email clients that both support HTML and don't support the image displaying (sometimes you will be prompted to download it etc. but it would work afterwards)

    Thanks, Michael