image fields in email templates

Is it possible to insert an image field into an email template that will display the image when the email is sent?  IE the contact's "photo" field.  When attempting this all it displays is the photo image file name.

Like 0

Like

10 comments

Dear Chris,

 

Please use the following example to implement your business task: 

1) Add image to the contact record

2) Create a process and add unlimited text parameter to it (https://imgur.com/pkTXVzy

3) Select data from the proper table and cast it to base64 string. Then save into unlimited text param via script task: https://i.imgur.com/2gY05iM.png

var userConnection = Get<UserConnection>("UserConnection");
Guid contactId = new Guid("4177bc0a-8cb1-4895-aacf-5932ed6b4cb5");
string base64String = "";
Select selectEmail = new Select(userConnection)
            .Top(1)
                .Column("Data")
            .From("ContactFile")
            .Where("ContactId").IsEqual(Column.Parameter(contactId)) as Select;
using (var dbExecutor = userConnection.EnsureDBConnection()) {
    using (IDataReader dataReader = selectEmail.ExecuteReader(dbExecutor)) {
        if (dataReader.Read()) {
            byte[] imageBytes = dataReader.GetColumnValue("Data") as byte[];
            base64String = Convert.ToBase64String(imageBytes);
        }
    }
}
base64String = "<img src=\"data:image/png;base64,"+ base64String +"\" />";
Set<string>("Image", base64String);
return true;

4) Add send email element to process and select "Custom message" option: https://i.imgur.com/7uLWGmN.png

5) Fill the email template with that unlimited text parameter: https://i.imgur.com/rjG2yek.pnghttps://imgur.com/J3Geqn2

6) Save the process and test it: https://i.imgur.com/0SiJiBM.png

 

Best regards,

Angela

Thanks! We will give this a try.

Angela Reyes,

 

the above appears to be a solution for using trigger emails in campaigns or processes.  Can above solution be used for bulk emails?

Chris King,

Currently, there is no way to achieve this task using macro in email templates for bulk emails - they cannot be customised as email templates in business processes. 

So your are telling me that there is no way to merge in an image field into a bulk email?  (Ie a signature head shot image/logo etc?)

Chris King,

An image can be added to the bulk email template as a static image. For now, there is no option to add macro for images to bulk email. 

 

Best regards,

Angela

So how does one go about inserting a signature for a salespersons picture?  This is hard to believe that this function is not supported.

Chris King,

It is not supported yet - however, you can create separate bulk emails with auditory according to the signature they should receive. 

 

Best regards,

Angela

No idea what that means... “auditory”?  For example if we do a bulk email to 50000 records and need to insert the appropriate signature layout for each linked user/owner and there are 300 users how would we do this without doing 300 separate bulk emails?

Chris King,

Unfortunately, there is no better workaround for your business task.  

 

Best regards,

Angela 

Show all comments