You mentioned three variables, but only list two. I assume, the third one is the destination/target email address?
Try this script snippet:
var player = GetPlayer(); var emailaddress=player.GetVar("targetEmail"); var email=player.GetVar("txtEmail"); var name=player.GetVar("txtName"); var subject="Course Completion"; var body_start="Dear Natalie,"+"\n"+name+" has completed the course. His/her email address is " +email+"."+"\n"+"Thank you"; var mailto_link='mailto:'+emailaddress+'?subject='+subject+'&body='+body_start; win=window.open(mailto_link,'emailWin');
2 Replies
You mentioned three variables, but only list two. I assume, the third one is the destination/target email address?
Try this script snippet:
var player = GetPlayer();
var emailaddress=player.GetVar("targetEmail");
var email=player.GetVar("txtEmail");
var name=player.GetVar("txtName");
var subject="Course Completion";
var body_start="Dear Natalie,"+"\n"+name+" has completed the course. His/her email address is " +email+"."+"\n"+"Thank you";
var mailto_link='mailto:'+emailaddress+'?subject='+subject+'&body='+body_start;
win=window.open(mailto_link,'emailWin');
Thanks - that works perfectly. Is there a way now to automatically send the email, without the user having to press send in the Mail client?
This discussion is closed. You can start a new discussion or contact Articulate Support.