Transactional Email does not store your images, but there are a few ways to include them in your emails. Below are some tips to help you get started.
-
Upload images to a publicly-accessible server or a reputable image hosting service. Then, link to the image URL in your message HTML or template:
<img src="http://photosite.com/image.jpg" alt="My image" />
-
You can also use merge tags to insert image names dynamically:
<img src="http://photosite.com/*|IMAGENAME|*" alt="My image" />
-
We recommend that you host your images on your own site instead of general sharing services. File and photo hosting sites could have other users' content on them and are more likely to be flagged by spam filters, be on denylists, or cause failed content reviews for your Transactional Email account.
-
Include images as inline attachments with your API calls using the
images
parameter. You must provide the image name (Content-ID), the content (as a base64 encoded string), and the image MIME type. Reference the image name in the 'src' in your HTML content:<img src="cid:image_name">
-
For most SMTP libraries, including inline images is handled automatically. For example, if you insert an image inline, an
img
tag is added which then references the Content-ID of the image that's attached. How to add inline images will depend on the SMTP library being used. -
Including inline images causes emails to be much larger since attachments are base64-encoded. This also means more data is being transferred to Transactional Email, and more data is also being sent to receiving servers. If you are using the same images often or sending in bulk, hosting those images and referencing them in your HTML is more efficient.
-
You cannot upload images to templates or store them in Transactional Email.