Image from URL in Transactional Email

Hi,
I have a problem with sending an email along with an image that is from a URL. For example, this [image](https://quickchart.io/chart?c={“type”:“bar”,“data”:{“labels”:[“January”,“February”,“March”,“April%20” , “May”], “datasets”: [{“label”: “hours”, “data”: [50,90,20,350,180]}]}}). In the email template I have this: <img src=“{{custom.usageChartURL}}” style = “width: 100%”> but if I send the email, image will not show (yes, I am sending the correct URL of the image, because if you look at the first photo from email, part of url is there).

MGebic_1-1636041347797.png

Thank you very much for your help!

Hey @MGebic is that a Custom Module? If so could you please paste the whole sourecode of the module.

Best regards,

Özcan

Yes, I tried both the module and the HTML directly in the email template.
HTML
<div style=“width: 50%;”>
<img src=“{{custom.usageChartURL}}” style=“width: 100%”>
</div>

Module
{% if module.usageChartURL.src %}
{% set sizeAttrs = ‘width=“{{ module.usageChartURL.width }}” height=“{{ module.usageChartURL.height }}”’ %}
{% if module.usageChartURL.size_type == ‘auto’ %}
{% set sizeAttrs = ‘style=“max-width: 100%; height: auto;”’ %}
{% elif module.usageChartURL.size_type == ‘auto_custom_max’ %}
{% set sizeAttrs = ‘width=“{{ module.usageChartURL.max_width }}” height=“{{ module.usageChartURL.max_height }}” style=“max-width: 100%; height: auto;”’ %}
{% endif %}
{% set loadingAttr = module.usageChartURL.loading != ‘disabled’ ? ‘loading=“{{ module.usageChartURL.loading }}”’ : ‘’ %}
<img src=“{{ module.usageChartURL.src }}” alt=“{{ module.usageChartURL.alt }}” {{ loadingAttr }} {{ sizeAttrs }}>
{% endif %}

with HTML I get only part of the URL, with the module I get only the default image.
I’m just starting with Hubspot, so please excuse my ignorance :slightly_smiling_face:

Hello @MGebic ,
Sorry for the late reply.

Maybe you could use a text function instead of an image function and insert the URL of the external image there.

Should look like this:

<img src=“{{module.image_url}}” style=“width:100%;height:auto”>

I hope it helps!

Best regards,

Özcan