Forum Discussion
Pulling text entries from SL360 and sending via email - Javascript
Ah thank you for that! So, here's my next curiousity...when I used your code I did get the email window to launch and the text was formatted correctly. However, when I use my actual text it's not working again. Here is my code with the actual text (not placeholder):
var player = GetPlayer();
var email = '';
var ans1 = player.GetVar('scenario1Q1');
var ans2 = player.GetVar('scenario1Q2');
var ans3 = player.GetVar('scenario1Q3');
var ans4 = player.GetVar('scenario2Q1');
var ans5 = player.GetVar('scenario2Q2');
var ans6 = player.GetVar('scenario2Q3');
var subject = 'Epic Service Returner - Module 4 Inputs';
var emailBody = 'SCENARIO 1: A family is looking for some things for the kids to do on their winter vacation. The mother is tired and a bit frazzled, and one of her kids is having a meltdown. She has a three year old son and a seven year old daughter. ' + '\n' + 'Q1: How will you adapt your communication to connect with this family? What might the guests’ body language, tone, and spoken word tell you about how they are feeling? What will you do with your body language to help these guests feel happy, excited, relaxed, and safe? What will you say and what will your tone be? ' + '\n' + 'My answer: ' + ans1 + '\n\n' + 'Q2: What open-ended questions can you ask to engage with the guest and put the focus of the conversation on them? To make them feel supported and taken care of? ' + '\n' + 'My answer: ' + ans2 + '\n\n' + 'Q3: What sorts of things will you suggest to help this family feel happy, excited, relaxed, and safe while visiting your resort? To improve their situation and create memorable moments that will culminate in the experience of a lifetime?' + '\n' + 'My answer: ' + ans3 + '\n\n' + 'SCENARIO 2: A man is staying at your resort a couple of days after his work conference ended and wants some suggestions of what he can do. He’s reserved and wants to take advantage of some time alone.' + '\n' + 'Q1: How will you adapt your communication to connect with this family? What might the guests’ body language, tone, and spoken word tell you about how they are feeling? What will you do with your body language to help these guests feel happy, excited, relaxed, and safe? What will you say and what will your tone be? ' + '\n' + 'My answer: ' + ans4 + '\n\n' + 'Q2: What open-ended questions can you ask to engage with the guest and put the focus of the conversation on them? To make them feel supported and taken care of? ' + '\n' + 'My answer: ' + ans5 + '\n\n' + 'Q3: What sorts of things will you suggest to help this family feel happy, excited, relaxed, and safe while visiting your resort? To improve their situation and create memorable moments that will culminate in the experience of a lifetime?' + '\n' + 'My answer: ' + ans6;
var mailto_link = 'mailto:' + email + '?subject=' + subject + '&body=' + encodeURIComponent(emailBody);
win = window.open(mailto_link, 'emailWin');
//window.location.href='mailto:'+email+'?subject='+subject+'&body='+encodeURIComponent(emailBody);
-------------------------
Is it too long by chance? Or other thoughts?