Skip to content

Instantly share code, notes, and snippets.

@lifeeric
Forked from rwbrockhoff/TwilioNotifiyDemo.js
Created October 31, 2020 01:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lifeeric/524e7eb5d9abc99eded85cc98a8c3bd5 to your computer and use it in GitHub Desktop.
Save lifeeric/524e7eb5d9abc99eded85cc98a8c3bd5 to your computer and use it in GitHub Desktop.
const bulkPhoneNumberList = invitations.map(person => {
return `{\"binding_type\":\"sms\",\"address\":\"+1${person.phone_number}\"}`;
});
const response = await client.notify
.services(process.env.TWILIO_NOTIFY_SID)
.notifications.create({
toBinding: phoneNumberList,
body: `Welcome to HyperCarrot! \nYou've been invited by ${orgName}. Click below to get started!\n${
process.env.FRONTEND_URL
}/register/mobile/${textInvitationToken}`
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment