Created
March 4, 2021 16:05
-
-
Save mb8z/b1c6c2b53a8c477368d666a68fc4be61 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
const dayjs = require('dayjs'); | |
const { SMS } = require('automagically'); | |
const templates = { | |
appointmentReminder: 'You have a doctor\'s appointment coming on {{date}}. Assigned doctor: {{doctorFullName}}', | |
}; | |
const dateFormat = 'YYYY-MM-DD HH:mm'; | |
const send = async () => { | |
const date = dayjs().format(dateFormat); | |
const doctorFullName = 'John Doe'; | |
// SMS with the same body | |
const sms = await SMS.send({ | |
from: { phone: '+44500500500' }, | |
to: [ | |
{ phone: 'PHONE_NUMBER_1', date, doctorFullName }, | |
{ phone: 'PHONE_NUMBER_2', date, doctorFullName }, | |
], | |
body: templates.appointmentReminder, | |
}); | |
}; | |
send(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment