Yet another Storyline Javascript email help request

Nov 11, 2015

I have read through the JS examples.

I've searched and read many of the JS Email related posts in the forums - and made sure testing was done on a web server or LMS (not local) and a Flash (not HTML5) version - as suggested in some posts.

And still, I can't get the JS code to work. It simply won't launch.

There is one thing I am not sure about and saw a mention in one of the posts. What happens if one or more of the variables I try to get from the player is empty - i.e. Tthe learner did not fill it in (this is possible in the flow). Will that prevent that JS from working properly?

If not - what might be the problem with the code?

If yes - is there a suggested workaround (as in some cases I need the variable to remain empty).

var player = GetPlayer();
var need = player.GetVar("NeedDevelop");
var important = player.GetVar("Importent");
var activity1 = player.GetVar("SubActiv");
var activity2 = player.GetVar("SubActiv02");
var activity3 = player.GetVar("SubActiv03");
var activity4 = player.GetVar("SubActiv04");
var activity5 = player.GetVar("SubActiv05");
var activity6 = player.GetVar("SubActiv06");
var activity7 = player.GetVar("SubActiv07");
var activity8 = player.GetVar("SubActiv08");
var activity9 = player.GetVar("SubActiv09");
var notes1 = player.GetVar("Implemented01");
var notes2 = player.GetVar("Implemented02");
var notes3 = player.GetVar("Implemented03");
var notes4 = player.GetVar("Implemented04");
var notes5 = player.GetVar("Implemented05");
var notes6 = player.GetVar("Implemented06");
var notes7 = player.GetVar("Implemented07");
var notes8 = player.GetVar("Implemented08");
var notes9 = player.GetVar("Implemented09");
var resources = player.GetVar("Resources");
var timeframe = player.GetVar("WhenActivity");
var evaluate = player.GetVar("HowActivityHelps");
var support = player.GetVar("HelpFromOthers");

var email = "";
var subject = "PMC Springboard Learning Action Plan";
var text = "Here is the summary of the learning plan." + "%0D%0A%0D%0A" + "%0D%0A%0D%0A" + "OBJECTIVE: Develop the skill & expertise in " + need + "%0D%0A%0D%0A" + "%0D%0A%0D%0A" + "Relevance: This is important or relevant because " + important + "%0D%0A%0D%0A" + "%0D%0A%0D%0A" + "How: Develop this skill by: " + "%0D%0A%0D%0A" + activity1 + ". Notes: " + notes1 + "%0D%0A%0D%0A" + activity2 + ". Notes: " + notes2 + "%0D%0A%0D%0A" + activity3 + ". Notes: " + notes3 + "%0D%0A%0D%0A" + activity4 + ". Notes: " + notes4 + "%0D%0A%0D%0A" + activity5 + ". Notes: " + notes5 + "%0D%0A%0D%0A" + activity6 + ". Notes: " + notes6 + "%0D%0A%0D%0A" + activity7 + ". Notes: " + notes7 + "%0D%0A%0D%0A" + activity8 + ". Notes: " + notes8 + "%0D%0A%0D%0A" + activity9 + ". Notes: " + notes9 + "%0D%0A%0D%0A" + "%0D%0A%0D%0A" + "RESOURCES: To be successful with this plan, the following resources are needed: " + resources + "%0D%0A%0D%0A" + "%0D%0A%0D%0A" + "Time frame: This plan will begin: " + timeframe + "%0D%0A%0D%0A" + "%0D%0A%0D%0A" + "Evaluate: To evaluate what was learned from this plan: " + evaluate + "%0D%0A%0D%0A" + "%0D%0A%0D%0A" + "Support: " + support + " will provide support for this plan.";
var mailto_link = 'mailto:' + email + '?subject=' + subject + '&body=' + text;
win = window.open(mailto_link, 'emailWin');

Thanks,

Amir

2 Replies

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