Forum Discussion

MichaelCohen-d0's avatar
MichaelCohen-d0
Community Member
8 months ago

Creating an email from a slide

I would like to create an email from a slide as a completion certificate.

I can have the user enter their name and email no problem from fields but I was wondering how to execute the rest so the slide compiles and launches a targeted email.

I searched but many of the solutions appeared fairly old.

Best, Steve

  • Actually I got Chat GPT to write this and it serves my needs:

    // Get the value of the LearnerName and LearnerEmail variables from Articulate Storyline
    var learnerName = player.GetVar("LearnerName");
    var learnerEmail = player.GetVar("LearnerEmail");

    // Define other email details
    var ccAddress = "steve.nixon@lakesidefamilydental.ca"; // CC recipient email address
    var subject = "Regarding your recent inquiry";
    var body = "Dear " + learnerName + ",\n\nI hope this email finds you well.\n\n";
    var line1 = "This is the first line of additional text.";
    var line2 = "This is the second line of additional text.";
    var line3 = "This is the third line of additional text.";
    var line4 = "This is the fourth line of additional text.";

    // Construct the mailto link
    var mailtoLink = "mailto:" + encodeURIComponent(learnerEmail) +
    "?cc=" + encodeURIComponent(ccAddress) +
    "&subject=" + encodeURIComponent(subject) +
    "&body=" + encodeURIComponent(body + line1 + "\n" + line2 + "\n" + line3 + "\n" + line4);

    // Open the email client
    window.location.href = mailtoLink;