emailing results

Hi all,

I have searched the forums and got some great answers for the above. Managed to achieved the result where:

an email is generated to the correct person

subject line populated

body of the email contains the txt and the score of the test using the code below: (from the forums here)

var player = GetPlayer();

var course="email test0.1"

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

var score=player.GetVar("finalresult");

var subject="using strata";

var body_start="I've completed the course 1 with a score of ";

var mailto_link='mailto:'+email+'?subject='+subject+'&body='+body_start+score

win=window.open(mailto_link, 'emailWin');

BUT

I just can't seem to get it to display a percentage sign at the end of the score?

It shows "I've completed the course 1 with a score of 87" all I want is a % symbol at the end!

Can anybody help?

10 Replies
Eric Brennan-Hazell

Hi all,

Managed to get it to do what I wanted! Thanks to those people whose bits fo Java I have used to create this! It will now open an email, populate the 'To:' and 'Subject:' fields and fill in the body with multiple quiz results, WITH a % sign at the end and a final result

var player = GetPlayer();

var course="email test0.1"

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

var score1=player.GetVar("ResultQ");

var score2=player.GetVar("ResultM");

var score3=player.GetVar("ResultMP");

var score4=player.GetVar("finalresult");

var subject="Using Strata e-learning";

var body_start="I've completed the Using Strata e-learning. My scores for each of the modules are:\n\r";

var body_one="Quotes and New Business: ";

var body_two="\n\rMTA and Cancellations: ";

var body_three="\n\rManage Policy: ";

var body_final="\n\rOverall Result: ";

var body_end= "%";

var mailto_link='mailto:'+email+'?subject='+subject+'&body='+encodeURIComponent(body_start)+(body_one)+score1+encodeURIComponent(body_end)+encodeURIComponent (body_two)+score2+encodeURIComponent(body_end)+encodeURIComponent (body_three)+score3+encodeURIComponent(body_end)+encodeURIComponent (body_final)+score4+encodeURIComponent(body_end)

win=window.open(mailto_link, 'emailWin');