MailTo Function for Bug Reporting

I'm currently working on a Bug Reporting feature for a course and for some reason my email body is showing up as truncated. Here is the script I'm using:

var player=GetPlayer();
var email="";
var subject="Bug_Report";

var body_start="Attention! I found a potential error in the following training. The name of the training is:  "+ player.GetVar("CourseName") + player.GetVar("Module") + player.GetVar("Frame");

var mailto_link='mailto:'+email+'?subject='+subject+'&body='+body_start;,'emailWin');

I've also created three variables (CourseName, Module, and Frame) in Storyline to contain these variables.

Any ideas on how I can correct this?


7 Replies
Dennis Hall

Hi Chad:

I looks like you need to create some temp vars and add tehm into your JavaScript.

I've attached a contact form Story that you can run out-of-box to compare.

Notice, in the script, I have created vars to assemble the email message and do not call GetPlayer in the email assembly part of the script.

Hope this helps you get on the right track with this form.

Best Regards,

Dennis Hall

John Griffiths

Hi Everyone,

I am struggling to get this feature to work, here is my JavaScript code which is based on Dennis's but I do not receive an email:

var player = GetPlayer();

var name = player.GetVar("lbname");

Var problempage = Player.GetVar("lbproblempage");

var problemdesc = player.GetVar("lbproblemdescription");

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

var subject = "Please help me in my course";

var body_start = "Hi" + name + " has sent the following question while in a course:\n";

var body_middle1 = "Problem spotted on page: ";

var body_middle2 = "Description of problem: ";

var cr = "\n";

var body_end = "Thank you";

var mailto_link = 'mailto:' +email+'?subject='+subject+'&body='+encodeURIComponent(body_start +body_middle1 +lbproblempage +cr +body_middle2 +lbproblemdescription+cr +body_end);

win =, 'emailWin');

Also attached is a screenshot of any relevant variables:

Any help would be greatly appreciated. 


Travis Smith

Besides the obvious limitations of the user having an email client, etc., the URI component has a limitation in length. In Internet Explorer, the limitation is 2,083 or 2,048 characters (see MS). Firefox (approx. 65,000), Chrome (unknown/documented limitation), Safari (approx. 90,000), and Opera (approx. 190,000) can handle much longer URIs. Yet according to the specs, HTTP has no limit to URI. Using data URI, Chrome and Firefox can handle about 2MB and 1MB respectively.

So handling the data or sending emails across browser can be problematic without access to the email protocols on the server.