Forum Discussion
User notes that they can print and email
Hi Holly,
A few thoughts from just taking a glance at your code. But I am not sure if your actual code is just like what is above? Or maybe the forum reformatted it?
Generally speaking you shouldn't have a hard line break in the middle of a variable. Your var mailto_link= has a line break after '&body='. And then a bunch more breaks after each entry. You should either make that one long line or append those to the end of the var like this:
var mailto_link='mailto:'+useremail+'?subject='+subject+'&body='
mailto_link += 'Journal Entry 1:%0d%0A'
There are a few other ways to handle that but the solution above should be fine for what you are doing.
Some of your strings have opening quote marks but no closing quote marks.
Also some of those quotes in your code are not the normal quotes. This is OK: " this is not “ . I know... they look almost identical. Avoid the curly looking ones. Using a code editor (like Sublime) will help you see those.
It is generally best practice to use double quotes around strings and to mix them with single quotes. You have some lines that start with single quotes append values in double quotes.
I think this may work for you:
var player = GetPlayer();
var useremail=player.GetVar("email");
var subject="Journal Entries";
var Thoughts9=player.GetVar("Thoughts9");
var Thoughts1=player.GetVar("Thoughts1");
var Thoughts2=player.GetVar("Thoughts2");
var Thoughts3=player.GetVar("Thoughts3");
var Thoughts4=player.GetVar("Thoughts4");
var Thoughts5=player.GetVar("Thoughts5");
var Thoughts6=player.GetVar("Thoughts6");
var Thoughts7=player.GetVar("Thoughts7");
var Thoughts8=player.GetVar("Thoughts8");
var mailto_link="mailto:"+useremail+"?subject="+subject+"&body="
mailto_link += "Journal Entry 1:%0d%0A"
mailto_link += Thoughts9+"%0d%0A%0d%0A"
mailto_link += "Journal Entry 2:%0d%0A"
mailto_link += Thoughts1+"%0d%0A%0d%0A"
mailto_link += "Journal Entry 3:%0d%0A"
mailto_link += Thoughts2+"%0d%0A%0d%0A"
mailto_link += "Journal Entry 4:%0d%0A"
mailto_link += Thoughts3+"%0d%0A%0d%0A"
mailto_link += "Journal Entry 5:%0d%0A"
mailto_link += Thoughts4+"%0d%0A%0d%0A"
mailto_link += "Journal Entry 6:%0d%0A"
mailto_link += Thoughts5+"%0d%0A%0d%0A"
mailto_link += "Journal Entry 7:%0d%0A"
mailto_link += Thoughts6+"%0d%0A%0d%0A"
mailto_link += "Journal Entry 8:%0d%0A"
mailto_link += Thoughts7+"%0d%0A%0d%0A"
mailto_link += "Journal Entry 9:%0d%0A"
mailto_link += Thoughts8+"%0d%0A%0d%0A"
win=window.open(mailto_link,"emailWin");
Hope that help!
Related Content
- 9 months ago
- 6 months ago
- 8 months ago
- 9 months ago
- 12 months ago