Assigning attributes to Variables within an Email via JavaScript

Feb 03, 2023

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.

4 Replies