email text variables to learner's email address (also a text variable)

Hi, I'm hoping someone can offer some assistance. Here's what I want to accomplish:

I have a course that contains an action plan. The learner completes the action plan (a few questions set up as text variables). Then they click an email button that emails the completed action plan to them. I ask the learner for their email address that's also saved as a variable. Any ideas on a good way to do this?

2 Replies
Megan Creegan

Actually, I think I figured it out!

I found this JS code in another discussion:

var player = GetPlayer();
var email=player.GetVar("EmailAddress");
var subject="Assessment Complete";
var body_start="I've just completed my assessment!";
var mailto_link='mailto:'+email+'?subject='+subject+'&body='+body_start;
win=window.open(mailto_link,'emailWin');

And it appears to work, but when I test it as a learner, it asks me to select an email client. My entire company is on Gmail, so is there a way to bypass that part and open gmail or automatically sent it to Gmail?

Ashley Terwilliger

Hi Megan, 

It'll rely on the individual user having a default email client set up, which if you're using a web based email such as Gmail, it's hard to set that as a default to refer for each individual user. I haven't seen a method shared in the Community to get around that set up yet, but I hope someone in the E-Learning Heroes community is able to prove me wrong.