Forum Discussion
Pulling Multiple Variables into an Email via JavaScript
Here is a solution to the course closing:var player = GetPlayer();
var email = player.GetVar('YourEmail');
var email2 = player.GetVar('SupEmail');
var email_address = email + '; ' + email2;
var subject = "Essential Soft Skills 101 Reflection";
var body_start = "Opening text to introduce email\n";
body_start += "\nQuestion 1:\n" + player.GetVar('Question1');
body_start += "\nQuestion 2:\n" + player.GetVar('Question2');
body_start += "\nQuestion 3:\n" + player.GetVar('Question3');
body_start += "\nQuestion 4:\n" + player.GetVar('Question4');
body_start += "\nQuestion 5:\n" + player.GetVar('Question5');
var encoded_body_start = encodeURIComponent(body_start);
var mailto_link = 'mailto:' + email_address + '?subject=' + encodeURIComponent(subject) + '&body=' + encoded_body_start;
window.open(mailto_link, '_blank');
- EarlKreuzer-e3e9 months agoCommunity Member
Hi Nedim, Is there a character count limit?
I can get 3 out of 5 questions with answers to work but it stalls after 3. Any insight or workaround would be helpful.
My word count is 350 plus ( writers love to be wordy). Plus the user may need to add to answers.
FYI: It does work for all 5 if i cut the count down to short answers.
TY>