Skip to main content
Known Participant
May 4, 2016
Question

Email Variable Value

  • May 4, 2016
  • 7 replies
  • 1395 views

Has anyone been able to email variable values using Captivate 9 HTML5 lessons with a button?

I'd like to send quiz results and a derived value using an action script.

Any help gratefully received.

Roger

This topic is closed to new replies. Start a new post to keep the conversation going.

7 replies

TLCMediaDesign
Inspiring
May 4, 2016

When you say ActionScript do you mean that you are using swf output?

To do this properly you do need to use an php page to send the email.

BatsninjaAuthor
Known Participant
May 4, 2016

Thanks for the reply, I probably need to clarify my requirements further.

I need to author stand alone HTML5 Captivate quizzes that do not rely on any external resources (i.e. an apache server with a PHP email handler for example). By Action script I mean the Advanced actions within Captivate. I want a button to open the native email client i.e. Outlook and populate the email body with content. I can get the following to work for IE but not Chrome sadly.

Text box set to Text_Entry_Box_1

Button with javascript:

myvar = window.cpAPIInterface.getVariableValue("Text_Entry_Box_1");

mailto_link = "mailto:"+myvar+'?cc='+myvar+'&subject='+myvar+'&body='+myvar;

window.location.href = mailto_link

Works great in IE11 but does nothing in Chrome

Thanks

Roger

BatsninjaAuthor
Known Participant
May 4, 2016

Ok sorry, I think I've solved it the correct code to work in both IE and chrome is window.location.assign

i.e.

myvar = window.cpAPIInterface.getVariableValue("Text_Entry_Box_1");

window.cpAPIInterface.setVariableValue("Text_Entry_Box_2",myvar);

mailto_link = "mailto:"+myvar+'?cc='+myvar+'&subject='+myvar+'&body='+myvar;

window.location.assign = mailto_link

Thanks anyways

Roger