Nov 28, 2022 2:44 PM
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?
thanks!
Nov 29, 2022 9:04 AM
Hi @Rituul,
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
<img src="{{ module.image_url }}" width="{{ module.image_width}}" style="width:{{ module.image_width }}px;">
hope this helps,
best,
Anton
Nov 29, 2022 8:47 AM
Hi @Rituul,
Thank you for reaching out!
I would like to invite our subject matter experts to see if they have any advice.
Hi @NicoleSengers, @ThinkLighthouse, @Anton - Do you have any insight for @Rituul?
Thank you!
Best,
Kristen
![]() | Did you know that the Community is available in other languages? Join regional conversations by changing your language settings ! |