Forum Discussion
JavaScript ?: Can I pull text from a text box into an email?
Hi Julie,
You can find reference here:
http://www.articulate.com/support/kb_article.php?product=st1&id=llwes8cn32vg
I suppose this should work.
Step 1. Create 3 variable in SL: email, subject, body_start
As the name suggest, they will contain respective content. You can fill them.
Step 2. Create a button and put a trigger to execute javascript, when clicked:
----------------------------------------------------------------------------------------------
var player = GetPlayer();
var email = player.GetVar(“email”)
var subject = player.GetVar(“subject”)
var body_start = player.GetVar(“body_start”)
var mailto_link='mailto:'+email+'?subject='+subject+'&body='+body_start;
win=window.open(mailto_link,'emailWin');
-----------------------------------------------------------------------------------------------------------
If you want to email it directly, without opening outlook, (which i think is neater), goto this thread:
http://community.articulate.com/forums/p/34669/191317.aspx#191317
Do tell me, if you face any problem.
Regards,
Kawstov
- ShaneTraynor-ef7 years agoCommunity Member
Just a minor correction, the variables should be between apostrophes, not quotation marks:
var player = GetPlayer();
var email = player.GetVar('email')
var subject = player.GetVar('subject')
var body_start = player.GetVar('body_start')
var mailto_link='mailto:'+email+'?subject='+subject+'&body='+body_start;
win=window.open(mailto_link,'emailWin');