Forum Discussion

MuhammadHaseeb-'s avatar
MuhammadHaseeb-
Community Member
2 years ago

Sending Email for Articulate Storyline to email

Hello All!

I am trying to send email from articulate storyline having the variable pts for score and TextLabel1 for user name. I am using the following code, but it does not work for me, is there is any solution or any other way to do this.

var subject = "Course Results";
var score = player.GetVar("pts");
var userName = player.GetVar("TextLabel1");
var message = "Dear " + userName + ",\n\nCongratulations on completing the course! Your score is: " + score + ".\n\nRegards,\n[Your Name]";

var recipientEmail = "hm005244@gmail.com"; // Replace with the actual recipient's email address

var mailtoLink = "mailto:" + encodeURIComponent(recipientEmail) +
                 "?subject=" + encodeURIComponent(subject) +
                 "&body=" + encodeURIComponent(message);

window.location.href = mailtoLink;

No RepliesBe the first to reply