Answered

How to create dynamic mail avatars from sender same way as in "Personal" mail template?

  • 30 August 2022
  • 1 reply
  • 30 views

I am on my way creating my first mail template and want to use the tiny avatar image at the bottom of the mail showing the profile picture from sender. I saw this in the default mail template "Personal" – but could not find a variable or similar to implement this into my custom mail template.

 

Please help :)

icon

Best answer by Milan 30 August 2022, 17:37

View original

1 reply

Userlevel 4
Badge +5

It's not dynamic content. You can have only {{ content }} and {{ unsubscribe_link }} OR {{ unsubscribe_url }} that you can use.

 

But there might be a workaround for this. I haven't tested it but I think it might work.

As attributes are used in the same way as the above dynamic elements, i.e. {{ custom_data.name_of_attribute | fallback:"ENTER FALLBACK HERE" }} where "name_of_attribute" is the custom attribute you have defined, for each user, and let's assume that it is the account owner (and the person you want to have as a sender of the email).

 

So, i.e. your contact Milan has account_owner = Joe and account_owner_avatar_url = www.yourdomain.com/avatars/joe.png

Other contact, Marco, might have account_owner = Jane and account_owner_avatar_url = www.yourdomain.com/avatars/jane.png

 

Then you can use it in HTML such as (note below where I'm using these attributes as a dynamic content):

<table width="100%" cellpadding="0" cellspacing="0" border="0" style="border-collapse: collapse; color: #545454; font-family: 'Helvetica',Arial,sans-serif; font-size: 13px; line-height: 20px; margin: 0 auto; max-width: 100%; width: 100%" class="message_footer_table">
<tbody><tr>
<td width="40" class="space">&nbsp;</td>

<td valign="middle" width="50" style="color: #272727;" align="left">
<img src="{{ account_owner_avatar_url }}" height="40" width="40" class="avatar" alt="intercomavatar">
</td>
 
<td class="admin_name" style="color: #999999">
<b>{{ account_owner }}</b> from YourCompany
 
</td>
</tr>
</tbody></table>

 

So Milan will get the email with Joe as a signature/avatar, and Marco will get it with Jane.

 

That should work, give it a test and report back please 🙂

 

Reply