Forum Discussion

AliciaSummers's avatar
AliciaSummers
Community Member
13 years ago

Send results slide via email using Javascript ??

Hello!  I'm pretty new to... well... all of this, but I'm a fast learner.  I've been toying around with adding Javascript to my Storyline project for some advanced capabilities, and so far I've figured out how to execute an email with HTML5.  I understand that there are issues with mobile and Flash.

So my question is: is it possible to set up Javascript within my Storyline project that will email an image of the results slide/certificate of completion? 

It would be great if the image could be in the body of the email, but I would also be happy if it were an attachment.  I don't know if it is possible to set it up so that once the user lands on the results/completion slide, there is an image automatically generated and included in the email.... again, pretty new at this. =)

Here is my current set up (for my test project) including code:

  • I set up a text entry called "EmailAddress"  - the user will enter their desired email addresses in here.
  • I have a text variable called "EmailAddress"
  • I added a trigger to a button that will execute Javascript when the user clicks.

This is the Javascript I'm using:

var player = GetPlayer();
var course="Storyline test course"
var email=player.GetVar("EmailAddress");
var subject="Assessment Complete";
var body_start="I've just completed my assessment!";
var mailto_link='mailto:'+email+'?subject='+subject+'&body='+body_start;
win=window.open(mailto_link,'emailWin');

Please note: I've patched my JS together from information I've found within these forums and on the web.  I don't know how to write JS or all the rules, but I can usually figure out how to use it if I play around with it for long enough.

Any help would be amazing, and thank you so much in advance... and sorry if this question has already been covered; I wasn't able to find an answer anywhere. =)

30 Replies