• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Emailing variables from Captivate 2019 not working

New Here ,
Apr 25, 2024 Apr 25, 2024

Copy link to clipboard

Copied

I am trying to email a Captivate 2019 variable, "cpquizinfopointsscored".  I have tried all the javascripts found in my searches, but none work.  Here is my current script....

var email="setname@mycompany.edu"; var subject="Final Score";
var myscore=window.cpAPIInterface.getVariableValue("cpQuizInfopointsscored");
var body_start="Final Score:%20";
var body_end=myscore;
var mailto_link='mailto:'+email+'?subject='+subject+'&body='+body_start +body_end;
win=window.open(mailto_link,'emailWin');

This is in Advanced Actions. The user clicks on a Click Box to run the script and open an email ready to just hit send. I defined “myscore” as a user variable.


First off, no matter what script I run I get….

cathiew61703017_0-1714049875995.png

 

And the email does not open. I have tried various scripts, sometimes the email will pop up but the “myscore” is not populated, just say myscore. I’m not familiar with javascript so I just basically copied and pasted ones I have found and replaced with my info.
I use the cpquizinfopointsscored within the project and the score is correct. Another point is I have reporting turned off for this project since it is not on any LMS but a standalone.

What am I doing wrong? 

TOPICS
Advanced actions , Quizzing and LMS

Views

142

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 25, 2024 Apr 25, 2024

Copy link to clipboard

Copied

I will not answer about the script, but the system variable is cpQuizInfoPointsscored and like all variables it is case sensitive. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 25, 2024 Apr 25, 2024

Copy link to clipboard

Copied

Hi there Cathie,

 

I think you may be misunderstanding how the Captivate Action you referred to actually works.  By default, the Send e-mail to action is only designed to spawn a new email in the end user's default email client software (e.g. Outlook or Mail).  It does not automatically send the email message. That requires the end user interacting with the e-learning module to execute the send, which would also allow them to change any part of the message (e.g. the score).

SendEmailTo.png

Captivate's Send email to action does allow you to have some very limited control over who the email is addressed to and what text appears as the subject line.  But it doesn't really give you the ability to customise the body of the message and insert system variables or custom user variables.  And the mailto: function cannot be relied upon unless you already know which email client your end users have on their system.  It might work for MS Outlook, but it would not work if they were using a web-based email application like Gmail, etc.

 

Yes it is possible with Javascript to do a lot more that Captivate allows, but if you are not a JS programmer or have a friend who is, then you would likely need to pay someone to help you create that functionality.  You would also need to have access to an email gateway to which your generated emails are sent.  Again, this is not something that Captivate offers out of the box.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 02, 2024 May 02, 2024

Copy link to clipboard

Copied

I understand that the email will not be automatically sent. That is not the issue. I want the email to populate with a Capitavate Varible and the user hit send.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 02, 2024 May 02, 2024

Copy link to clipboard

Copied

LATEST

As I mentioned earlier, Captivate doesn't do what you want out of the box.  That kind of functionality requires custom JavaScript programming.  If nobody here is able to provide you with that code and instructions about what to do with it, then you may need to consider engaging the services of a programmer.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 02, 2024 May 02, 2024

Copy link to clipboard

Copied

You can only run JavaScript in HTML - you need to use "Preview" > "HTML 5 in Browser" or you can "Publish"  > "Publish to Computer" and then upload the ZIP file to your LMS ansd view it thru that

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Help resources