Start a new topic
Answered

Moustache Email Template Images

Hi there, is there a way of adding images to the Moustache email template? Thanks


Best Answer
Ramesh,

I implemented your scenario in my environment using this link and able to add an image to the mustache email template. You can add an image to the mustache email template as following:

 

{{#fname}}<p>Dear {{fname}},</p>{{/fname}}
{{^fname}}<p>Dear {{username}},</p>{{/fname}}

Welcome!

<p>Please click on the link below to confirm your email address for app {{appname}}:</p>

<p>
<a href="{{url}}">{{url}}</a>
</p>

 <img src="https://www.kinvey.com/wp-content/uploads/2016/03/kinvey-mark-orange.png" alt="kinvey.com">

<p>Please copy the link to your browser if you are unable to click in email.</p>

<p>This link will expire in less than {{expirationTimeDays}} days ({{expirationDate}}).</p>

<p>If you did not sign up for the app, please ignore this email.</p>

<p>Sincerely,</p>
<p>Your {{appname}} team.</p>

 


I received following email for user verification:

image



Let me know if you face any issues while implementing this.



Thanks,
Pranav

 


Hi Ramesh,

We are happy to hear that. Please let us know if you have any other questions.

Regards,
Abhijeet

Hi Pranav


Figured out another way - it seems to work through a HTML email body. I'll go with this rather than a Mustache.


Thanks for your help!


Ramesh

Ramesh,

Your reply created new ticket on portal. I am copying your comment here to complete the loop:

"Hi Pranav


Thank you for your reply. I was actually trying to add an image through a Custom Endpoint (apologies, I should have been clearer). Using your example, I tried the below to add an image to the start of an email:


 

spec = '<img src="{{data.src}}"/>' + '\nHello there {{data.name}} happy {{data.age}}th birthday!';

output = render(spec, {data: 

                         {name: "Ramesh", 

                          age: "100", 

                          src: "https://www.kinvey.com/wp-content/uploads/2016/03/kinvey-mark-orange.png" }

                        });


But it didn't do the job... any thoughts? Is it possible within a Custom Endpoint?


Thanks

Ramesh"

 

Answer
Ramesh,

I implemented your scenario in my environment using this link and able to add an image to the mustache email template. You can add an image to the mustache email template as following:

 

{{#fname}}<p>Dear {{fname}},</p>{{/fname}}
{{^fname}}<p>Dear {{username}},</p>{{/fname}}

Welcome!

<p>Please click on the link below to confirm your email address for app {{appname}}:</p>

<p>
<a href="{{url}}">{{url}}</a>
</p>

 <img src="https://www.kinvey.com/wp-content/uploads/2016/03/kinvey-mark-orange.png" alt="kinvey.com">

<p>Please copy the link to your browser if you are unable to click in email.</p>

<p>This link will expire in less than {{expirationTimeDays}} days ({{expirationDate}}).</p>

<p>If you did not sign up for the app, please ignore this email.</p>

<p>Sincerely,</p>
<p>Your {{appname}} team.</p>

 


I received following email for user verification:

image



Let me know if you face any issues while implementing this.



Thanks,
Pranav

 

Login or Signup to post a comment