Include html in mailto email template?

robhaas
Tera Contributor

In my approval notifications, I call a mail template of ${mailto:awu} which puts an HTML mailto link in the notificatoin. The awu template is on the sysapproval_approver table, and is attempting to pull an html field from the approval for (sysapproval) and put that in the mailto response as html. However, the html comes through as plaintext. Any thoughts on how to make this come through as html? The notification type is html.

4 REPLIES 4

Nia McCash
Mega Sage
Mega Sage

Are you attempting to put html in the 'body' attribute of your mailto link like:
<a href="mailto:test@test.test?body=<h1>Some HTML text here</h1>">Link text goes here</a>



If so, it doesn't seem like this is possible:


Within the awu template, I am doing the following:



Click here to approve ${sysapproval} with updates you have made.



Summary:


Update: ${sysapproval.awu_html}




So the notification has the following sent to the approver:


A request has been received and requires your Approval or Denial.



${mailto:approval}


${mailto:rejection}


${mailto:awu}





When the end user clicks the mailto:awu link, a new email opens with the above message and summary and attempts to pull the awu_html field from the incident which is the sysapproval. The data from the awu_html field comes in as plaintext instead of html.



Does that make sense or more confusing?


According to Re: MAILTO - email script, ${mailto:} is just ServiceNow's conveniently provided way for you to create an email link (eg. <a href="mailto:... ).   So, unfortunately, the information I posted above still applies.   There is no way to create an email link which contains HTML in the body of the email.   This is not a ServiceNow restriction but a restriction of the mailto URI/URL scheme.



The ServiceNow platform is smart enough to strip the HTML tags from your awu template so that you can have plain text.   Otherwise your generated email would contain HTML tags as part of the email message.


neethu4
Giga Expert

Please let me know if you could achieve this