automatically generate data to an email


I'm creating an eLearing without using a LMS. The company needs to know the name and department number of the users that have completed the course. The quiz result is not necessary. I have created a data entry fields for the variables (Name and DepartmentNumber) and a trigger to send an email. 

My problem is how do I automatically generate the data from the variables into the email?

I have from previous discussions understood that this is not an easy task and that I probably need to use JavaScript (which I don't have experience with).  However, these posts are 2 years old. Has there been any progress on the matter in Storyline 2?



4 Replies
Matthew Bibby

Hi Madeleine,

Try this:

var player=GetPlayer();
var traineremail=";";
var learnersname=player.GetVar("Name");
var learnersdeptnum=player.GetVar("DepartmentNumber")
var subject="Course Complete";
var emailtext=" has completed the course."

var mailto_link='mailto:'+traineremail+'?subject='+subject+'&body='+escape(learnersname+' of department '+learnersdeptnum+emailtext);,'emailWin');

This assumes that you have the variables Name and DepartmentNumber set up in your course.

Change to the email address you want these messages sent to.

You can also change the Course Complete subject line and has completed the course text to make it clear which course has been completed.

Here is a demo and the source file is attached.

Hope that helps.