Using Javascript to email notes

Mar 25, 2022

Hi -

I'm building a project that includes a notepad where learners can take notes on the slide.  The notes are compiled at the end of the course so the learner can email them to themselves or others.  

The Javascript that triggers the email works, but the text appears as one long line.  It doesn't show any line breaks or carriage returns.  

Does anyone know how I can adjust my javascript so the text is formatted correctly in their email?  I know I've seen something on here about how to do this, but I didn't bookmark it and dang if I can't find the thread now!  

This is the script for the email trigger:

var player = GetPlayer();
var email = player.GetVar("TextEntry");
var subject="Full Item Spec Sheet";
var thoughts1 = player.GetVar("Thoughts1");
var thoughts2 = player.GetVar("Thoughts2");
var thoughts3 = player.GetVar("Thoughts3");
var body_start = thoughts1+' '+ thoughts2+' '+thoughts3;
var mailto_link = 'mailto:' + email + '?subject=' + subject+'&body='+body_start;
win=window.open(mailto_link,'emailWin');

TIA for any help!

1 Reply