Forum Discussion

ShaeZeitz's avatar
ShaeZeitz
Community Member
3 years ago

Javascript for sending Storyline 360 text entries via email

Within SL, I've been trying to initiate an email via javascript that contains text entry content, but I cannot get it to work. Essentially, I want the learner to be able to send their notes to themselves/others in an email.

I get halfway there: I'm able to generate a new browser tab (via each of the below separate sets of java), but no Outlook email generates. Each of them, when tested separately, only opens a Chrome browser tab.

What am I doing wrong? I need it to generate an Outlook email.

JAVA 1

var player = GetPlayer();
var email='';
var subject='Tracks Course Notes';
var feedback=player.GetVar('MyNotes');
var emailBody = +feedback
var mailto_link='mailto:'+email+'?subject='+subject+'&body='+encodeURIComponent(emailBody);
win=window.open(mailto_link,'emailWin');

 

--------------------------

JAVA 2

var player = GetPlayer();

var useremail=player.GetVar("Email");

var subject="Tracks Training Notes";

var notes1=player.GetVar("MyNotes");

var content="Tracks Training Notes%0d%0A%0d%0A";

content+=notes1;

var mailto_link='mailto:'+useremail+'?subject='+subject+'&body='+content;

win=window.open(mailto_link,'emailWin');

 

-------------------------------

JAVA 3

var player = GetPlayer();
var email=player.GetVar("Email");
var subject="Tracks Training Feedback";
var body_start=player.GetVar("MyNotes");
var mailto_link='mailto:'+email+'?subject='+subject+'&body='+escape(body_start);
emailwin=window.open(mailto_link,'emailWin');
emailwin=window.close();