Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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