Created
December 11, 2012 21:59
-
-
Save ivanstoyanov/4262638 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function onPostSave(request, response, modules) { | |
var to, logger = modules.logger, email = modules.email, body = request.body; | |
for (var i = 0; i < body.invitees.length; i++){ | |
/* assumes the following request JSON body | |
{ | |
"invitees": ["invitee1@gmail.com", "[email protected]"], | |
"subject": "New invitation", | |
"body": "You are invited to this awesome new event. Hope you can make it", | |
"reply_to": "[email protected]" | |
}*/ | |
to = body.to[i]; | |
logger.info("Sending e-mail to: " + to); | |
email.send('[email protected]', to, body.subject, body.body, body.reply_to); | |
} | |
response.continue(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment