Question: How to email result slide
Jun 13, 2016
Hello all,
I am working on a project that allows people to complete a self-assessment and then email the results to their managers. The result slide consists of a table and multiple check marks (images).
I tried using the following JS from another discussion thread - but nothing gets attached.
var player = GetPlayer();
var email = player.GetVar("ManagerEmail");
var name = player.GetVar("name");
var texto = player.GetVar("Commitment") + "\n";
var subject = "My Competency 180 Self-Assessment";
var body_start = "Dear Manager,\n" + name + " has sent you his/her Competency 180 Self-Assessment:\n";
var body_end = "Please discuss this self-assessment with " + name + "\n";
var mailto_link = 'mailto:' + email + '?subject=' + subject + '&body=' + encodeURIComponent(body_start + texto + body_end);
win = window.open(mailto_link, 'emailWin');
I assume I am missing something. I am not very good with JS, so I am not too sure what the var texto is for. I assume this is a key piece that I am missing. This script is specific to the thread from which I took the JS, so I am not too sure how to edit for my project.
Any help would be greatly appreciated.
Thanks!
8 Replies
Thank you Matthew for taking the time to walk me through the code.
Is there any way to email the slide contents to someone? Any JS to accomplish this?
Thanks!
Sean
Hi Matthew,
I have attached an image of the slide. Basically, the user goes through a series of 8 questions to self-assess where he/she is on a proficiency scale. I have variables to track the responses. The results slide then makes visible a check mark based on the variable triggered.
As mentioned, I want the user to be able to email the slide to his/her manager.
Thanks for any assistance you can provide!
Hi, Sean -- Thanks for reaching out and I see that Matthew is providing you with some great guidance here! I thought I might stop in to note in case you were unaware, JS coding is not something for which we are able to offer support, but I wanted to pass along this sheet with our JavaScript Best Practices and Examples.
Thanks Christie!
Hi Matthew,
Yes, I was also thinking that I may need to head in that direction & create some text entry fields with variables.
Yes, I think I can piece it together from the code above. Thanks so much for your assistance Matthew. Hopefully, I can get the JS figured out and not need to take up more of your time on this one. Much appreciated!!
Hi Matthew,
It seems that I was overconfident in my ability to edit the JS. I tried and the email window didn't even launch.
I am trying to add to the body text of the email a list of the competency names & the self-assessment score that is being generated from variables within Storyline.
I want the body to read something like this:
Competency 1= underskilled (which would is generated from the user with a text variable of C1)
Competency 2=(value of C2 text variable)
Competency 3=(value of C3 text variable)
So on for the 8 competencies.
I would appreciate any direction you can provide.
Many thanks - Sean
Matthew - You are amazing! I can't thank you enough. It works beautifully! Thank you!
This discussion is closed. You can start a new discussion or contact Articulate Support.