E-mailing Notes using JavaScript

Apr 25, 2019

Hi! I'm trying to send notes to an e-mail using this tutorial, but somehow I'm hitting a roadblock. When I click my e-mail icon, nothing happens. I've tried opening and publishing Stephanie's course on my computer, and the e-mail function works then. I've also tried troubleshooting by copy/pasting her exact button and code into my file, but that also doesn't seem to work. Would someone mind checking my code to make sure this looks correct? I feel like something must be wrong in how I have my file set up, but I'm super new to Articulate (I've used Lectora for 3 years and recently changed companies/authoring tools) and can't figure out what I'm doing wrong.

I appreciate any and all assistance!

var player = GetPlayer();

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

var subject="My IPA Training Reflections";

var usernotes=player.GetVar("notes");

var exercisenotes1=player.GetVar("ProductReflection");
var exercisenotes2=player.GetVar("BenefitsReflection");
var exercisenotes3=player.GetVar("ContractReflection");

var mailto_link='mailto:'+useremail+'?subject='+subject+'&body=
'+"Reflection Notes – My thoughts on product knowledge:%0d%0A"
+exercisenotes1+"%0d%0A%0d%0A
Reflection Notes – My thoughts on product benefits:%0d%0A"
+exercisenotes2+"%0d%0A%0d%0A
Reflection Notes – My thoughts on finding contract elements:%0d%0A"
+exercisenotes3+"%0d%0A%0d%0A
Reflection Notes - My thoughts on answering customer questions:%0d%0A"+usernotes;

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

2 Replies
Walt Hamilton

js troubleshooting tip:

put this line after line 1 of your javascript:

alert("I am at location 1");

If the js is executing correctly, when it reaches this line, it will stop and show a dialog box. Then move it down a line, and run again. If at some point the dialog box doesn't show, the script has hit an error and stopped executing on the previous line. If the script runs all the way through, the problem is not in the js

 

If her course runs on your computer, and pasting her code does not, your variables may have different names. Remember, variable names are case-dependent.

Amanda Ensworth-Himes

Thank you for the tip! The alert doesn't pop up ever, regardless of where it's added to the script. (I tried it at the very first line, after the first line, and at the end, just to cover bases.) I've checked all my variables and cases. Has anyone heard of this problem with Storyline 3? Do I need to change my player?

This discussion is closed. You can start a new discussion or contact Articulate Support.