Forum Discussion
Pulling Multiple Variables into an Email via JavaScript
Okay, the emails are working now, Thank you! I have also figure dout how to separate the paragraphs. Here's the latest code:
var player = GetPlayer();
var email=player.GetVar('YourEmail');
var email2=player.GetVar('SupEmail');
var email_address = email+'; '+email2;
document.write("\n");
var subject="Essential Soft Skills 101 Reflection";
var body_start=new Array("Opening text to introduce email");
body_start[1]= "\n" + ('Question 1: ') +"\n" + (player.GetVar('Question1'));
body_start[2]= "\n" + ('Question 2: ') +"\n" + (player.GetVar('Question2'));
body_start[3]= "\n" + ('Question 3: ') +"\n" + (player.GetVar('Question3'));
body_start[4]= "\n" + ('Question 4: ') +"\n" + (player.GetVar('Question4'));
body_start[5]= "\n" + ('Question 5: ') +"\n" + (player.GetVar('Question5'));
var mailto_link='mailto:'+email_address+'?subject='+subject+'&body='+escape(body_start);
emailwin=window.open(mailto_link,'emailWin');
emailwin=window.close();