Skip to content

Instantly share code, notes, and snippets.

@wpsmith
Created March 22, 2013 13:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wpsmith/5221305 to your computer and use it in GitHub Desktop.
Save wpsmith/5221305 to your computer and use it in GitHub Desktop.
Creates New Email with To, Subject, and basic body text.
var player = GetPlayer();
var email = player.GetVar("ManagerEmail");
var name = player.GetVar("Name");
var texto = player.GetVar("Commitment") + "\n";
var subject = "My Corporate Responsibility Commitment";
var body_start = "Dear Manager,\n" + name + " has sent you his/her Corporate Responsibility Commitment:\n";
var body_end = "Please discuss this commitment with " + name + "\n";
var mailto_link = 'mailto:' + email + '?subject=' + subject + '&body=' + encodeURIComponent(body_start + texto + body_end);
win = window.open(mailto_link, 'emailWin');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment