Hey all,
We want to be able to load the image from an image url called from our connected database in our email marketing. Being able to personlize the email further with custom images based on receipiant feels like a good idea to us. Does anyone have any insight as to how I might be able to do that?
there are many different ways. I think the easiest one would be a simple custom module with a simple text(not rich-text) for placing the URL into. For this example I’ve named it “Image url”. The code looks like this:
<img src="{{module.image_url}}">
If you’d like to have more options like links, sizing … you can modify it but keep in mind that it should be inline-css (unless you have custom html email templates)
to add a link, add either a URL or another simple text field to the module and modify the code to this:
{% set href = module.image_link.url.href %}
{% if module.image_link.url.type is equalto "EMAIL_ADDRESS" %}
{% set href = "mailto:" + href %}
{% endif %}
<a href="{{ href }}" % if module.image_link.open_in_new_tab %}target="_blank"{% endif %} {% if module.image_link.rel %}rel="{{ module.image_link.rel }}"{% endif %}>
<img src="{{module.image_url}}">
</a>
to add sizing simply add at least one number field and modify the code like this