How to add dynamic image to mail template (email connector)

0
Hello, Team.  I'm trying to add dynamic images in my template body via the email connector, but I can not seem to find a solution. Can someone please give me a hint? The Email Connector module is already configured and it's working properly.  
asked
4 answers
1

Hi Georgi,

You can download the image hosting module

https://marketplace.mendix.com/link/component/120706/Mendix/Image-Hosting

and using that, you can host your images in your website itself,

And in the email connector, you can use the Image's URL ( that will be generated automatically in the image hosing page), and use it in the email content as an HTML href tag.

Let me know if you have any issues,

Hope it helps!

answered
1

Hello Georgi,

 

You should copy/clone your Image objects to entity Attachments and then associate them with your Email object. That way they get picked up by the Java action and are attached to your sent email. 

 

*Update*

- Create EmailMessage object (as you already have done)

- For every Image object you create a Attachment object, be sure to set the Attachment.Name (so filename with extension), otherwise recipients won't be able to open them. 

- Use the CommunityCommons.DuplicatieFileDocument to copy the contents from Image to Attachment

- Associate the Attachment with your EmailMessage object

- Use SUB_SendEmail and your attachments will get sent out. 

answered
0

изображение.png

What I mean by tokens

answered
0

So, I managed to store the Image token via the "Generate HTML(.html) document using template" activity. Then I call that token from the email connector.

answered