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

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.  
4 answers

Hi Georgi,

You can download the image hosting module

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!


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. 



- 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. 



What I mean by tokens


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.