Forum Discussion

AnnaLundy's avatar
AnnaLundy
Community Member
5 years ago

Sending email from inside course

Hi All,

I'm trying to set up a "certificate of course completion" email users can send themselves from within the course. End goal: the user gets an email listing the course name and page number (pulled from variables) and asserting they have completed the course.

Has anybody pulled this off before?

Thanks,

1 Reply

  • AnnaLundy's avatar
    AnnaLundy
    Community Member

    I found that earlier, but following (or working based on) those examples hasn't worked out for me. My most recent try is below:

    var player = GetPlayer();
    var email = player.GetVar('UserEmail');
    var subject = 'Certificate of Course Completion';
    var emailBody = 'The recipient of this email has completed ' + CourseName + '. ' +'Sent from ' + PageNumber + '.';

    var mailto_link = 'mailto:' + email + '?subject=' + subject + '&body=' + encodeURIComponent(emailBody);

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