Skip to content

Instantly share code, notes, and snippets.

@RobSpectre
Created May 10, 2016 19:21
Show Gist options
  • Save RobSpectre/a3b06b12b433512dbff62cd8419cb669 to your computer and use it in GitHub Desktop.
Save RobSpectre/a3b06b12b433512dbff62cd8419cb669 to your computer and use it in GitHub Desktop.
var twilio = require('twilio');
// Will use TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN env vars
var twilio_client = new Twilio();
var notify = client.notifications.v1.services("ISxxxx");
// create list of installs and declare signal_peeps
signal_peeps.forEach(function(signal_peep) {
notify.bindings.create({
identity: signal_peep.email_address,
tag: "SIGNAL attendee"
}).then(function(response) {
console.log(response);
}).catch(function(error) {
console.log("Error: " + response);
});
});
notify.notifications.create({
tag: "SIGNAL Attendee",
body: "Thanks for coming to SIGNAL! Get notify at https://twilio.com/docs/notify",
}).then(function(response) {
console.log(response);
}).catch(function(error) {
console.log("Error: " + error);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment