Forum Discussion
Assigning attributes to Variables within an Email via JavaScript
Hello, I have set up an email trigger using JavaScript which works:
var player = GetPlayer();
var email="[my email address]";
var subject="Assessment: Manual Handling";
var body_start=("Attention! Employee number: " + player.GetVar("Username") + "has not achieved the required passmark in the course: " + player.GetVar("CourseName") + "and may require further training.");
var mailto_link='mailto:'+email+'?subject='+subject+'&body='+body_start;
emailwin=window.open(mailto_link,'emailWin');
emailwin=window.close();
However, I would also like to add the following attributes to content within the body of the email:
- Bold the word Attention! and colour it red
- Bold the Username and CourseName variables
After much research, trial and error, I am unable to get it to work for me. If anyone can help, I'd really appreciate it. Thanks.
- Jürgen_Schoene_Community Member
the whole mailTo-link is plain text (no bold, no colors, ...)
for bold/italic/underline there is a trick with Mathematical Alphanumeric Symbolshttps://stackoverflow.com/questions/32947586/mailto-and-format-bold-italic
but it's only available a-zA-Z - no special chars
Jürgen- JohnCooper-be3cCommunity Member
Not really an answer to your question I'm afraid - but this post might help ? or not!
- SoniaLewis-e975Community Member
Thanks for the link John :)
- SoniaLewis-e975Community Member
"the whole mailTo-link is plain text (no bold, no colors, ...)" - of course it is! haha
Thanks for the link but not being a real coder I'm afraid it means nothing to me. I've decided not to worry about it and just leave as plain text. Thanks for your help :)