Send email via Mobile app with html data in email body

Hi Folks,

How I can send email with html designated card to email body via mobile app?

Another hand, I have card designed using html so this card I would like to share via email.

Kindly provide the way how to do this.

Thanks




Hi Meer Imtiyaz,

Can you include that HTML card, as layout of your email widget (see web widget)?

Regards,

Meer Imtiyaz

Also, there are already email structures from Silk that you can use, see here some examples in Silk UI Sample Pages.

Cheers!

Hi Meer,

To send e-mail from a Mobile App, you need to call a Server Action to do so - there's no way to directly send an e-mail from a mobile device.

If you want to include HTML as a body, you can either send that from your Mobile application, or from the Server, depending on the source of the HTML (if it's fairly static, I wouldn't send it from the Mobile App). To actually include it in an e-mail message using the Platform e-mail is not entirely trivial, but it can be done. An alternative would be to use the Richmail Extension.

Marco Arede wrote:

Hi Meer Imtiyaz,

Can you include that HTML card, as layout of your email widget (see web widget)?

Regards,

Hi Marco,

Thanks for you response, let me check this and will get back to you if find proper solution. 


Kilian Hekhuis wrote:

Hi Meer,

To send e-mail from a Mobile App, you need to call a Server Action to do so - there's no way to directly send an e-mail from a mobile device.

If you want to include HTML as a body, you can either send that from your Mobile application, or from the Server, depending on the source of the HTML (if it's fairly static, I wouldn't send it from the Mobile App). To actually include it in an e-mail message using the Platform e-mail is not entirely trivial, but it can be done. An alternative would be to use the Richmail Extension.

Hi Killian,
Greetings!

I have tried "mailto:?subject= &body=" it worked as expected (without Server action), but here not able to send card that is designed by html.

Server action:
I am not able to pass html card in email widget, can you please provide the way to use email widget?
I have done with SMTP setup on Server side.

Motive of app to send email:
First preference to send email by Mobile itself like happening by "mailto:" URL but here issue is  unable to send the html design.

Kindly provide better solution hint.

Thanks

Hi Meer,

When you use a "mailto" anchor, you are just instructing your mobile browser to start your mobile e-mail app. That's indeed fairly limited in what you can achieve. Also, you don't actually send any e-mail in that case, you just fire up your e-mail app. If that's what you want, you could take a look at this plugin.

As for the Server Action, if you want to pass the HTML content, use an Input Parameter to the E-mail Screen (if there's not too much HTML), or store it in the database and use the Id as Input to the Screen (and retrieve the content with an Aggregate in the Preperation). Next have an Expression in the E-mail Screen that you populate with the HTML (set Escape Content to False). Make sure the E-mail Screen is in it's own Flow, using it's own Theme (or you'll get a lot of CSS that you don't want sent along with it).

Kilian Hekhuis wrote:

Hi Meer,

When you use a "mailto" anchor, you are just instructing your mobile browser to start your mobile e-mail app. That's indeed fairly limited in what you can achieve. Also, you don't actually send any e-mail in that case, you just fire up your e-mail app. If that's what you want, you could take a look at this plugin.

As for the Server Action, if you want to pass the HTML content, use an Input Parameter to the E-mail Screen (if there's not too much HTML), or store it in the database and use the Id as Input to the Screen (and retrieve the content with an Aggregate in the Preperation). Next have an Expression in the E-mail Screen that you populate with the HTML (set Escape Content to False). Make sure the E-mail Screen is in it's own Flow, using it's own Theme (or you'll get a lot of CSS that you don't want sent along with it).

Hi Kilian,
Thanks for reply.

This worked for me.

Great Thanks for your Good support. (Y)



Kilian Hekhuis wrote:

Hi Meer,

When you use a "mailto" anchor, you are just instructing your mobile browser to start your mobile e-mail app. That's indeed fairly limited in what you can achieve. Also, you don't actually send any e-mail in that case, you just fire up your e-mail app. If that's what you want, you could take a look at this plugin.

As for the Server Action, if you want to pass the HTML content, use an Input Parameter to the E-mail Screen (if there's not too much HTML), or store it in the database and use the Id as Input to the Screen (and retrieve the content with an Aggregate in the Preperation). Next have an Expression in the E-mail Screen that you populate with the HTML (set Escape Content to False). Make sure the E-mail Screen is in it's own Flow, using it's own Theme (or you'll get a lot of CSS that you don't want sent along with it).

Hi Kilian,

I would like to pass data in HTML card by input parameter.

I tried it but there showing warning message "Ensure the expression is protected by using EncodeHTML(), or SanitizeHTML() from the Sanitization extension, to avoid security flaws"

Kindly provide the solution how to pass input parameter data in HTML card.

Thanks

Solution

That's a warning only, that in this case you can safely ignore by selecting it in the TrueChange tab, and pressing Ctrl-H.

Solution

Kilian Hekhuis wrote:

That's a warning only, that in this case you can safely ignore by selecting it in the TrueChange tab, and pressing Ctrl-H.

Thanks Kilian, yes it was just warning message.

Now email template working as I expected.

Thanks for your good support!


You're most welcome :). Happy coding!