In this post, we'll walk through all the steps needed to build an email leveraging dynamic images. This can be useful to send the relevant image to each profile based on their attributes. For example, let's assume you'd like to include a different medal image for each customer's achievement or level.
1. Upload Images to Assets:
- Log in to your Customer.io account and navigate to the "Assets" section.
- Upload the images you want to use in your dynamic emails.
2. Create Snippets for Dynamic Images:
- Snippets in Customer.io allow you to personalize content based on customer attributes.
- Create a snippet named, for example, {{snippets.league_image}} to dynamically associate images with different customer levels (eg. gold medal for gold league level etc)l.
3. Use Liquid in Snippet Content:
- Utilize Liquid within your snippet to dynamically fetch the appropriate image URL based on the customer's level.
- The provided Liquid code checks the customer's level and inserts the corresponding image URL.
4. Add Dynamic Image in Drag-and-Drop Editor:
- Open the drag-and-drop editor for your email campaign.
- Add an image block and enable the 'dynamic image' option.
- Copy and paste the snippet name into the dynamic image field.
- Below, provide a fallback image URL that will be displayed if the dynamic content is unavailable.
Pro tip: The editor will determine the sizing of your dynamic image based on your fallback image. If it’s displaying too big or too small, make sure you’ve got a right-sized fallback image specified.
Here there is an example of how it would look:
---