Parsing %Results.ScorePoints% into the body of an email
Apr 26, 2021
Hi,
I have JavaScript creating an email and populating it with the required data, but i cannot get my %Results.ScorePoints% into the body block at all, has anyone managed to do this? I have the following working so far:
var player = GetPlayer();
var email = player.GetVar("supemail")
var emailTwo = "testing@test.com"
var subject = 'Testing Testing Assessment';
var emailBody = 'Congratulations on completing the Testing Testing Assessment:' + '\n' + '\n' + 'Your score is: ' ;
var mailto_link = 'mailto:' + email + ';' + emailTwo + '?subject=' + subject + '&body=' + encodeURIComponent(emailBody);
win = window.open(mailto_link, 'emailWin');
I have tried a variety of ways to get the score in but can't.
Thanks,
Karl W
3 Replies
Accessing the built in variables directly is nigh impossible. Try adding your own score variable and a trigger that sets your new variable equal to the built in score variable. Then, in your JavaScript, retrieve the new variable's value.
Thanks, i will try that...
I have managed to get this working, finally...i am more familiar with using variables now and am having fun!!!! Thanks...