Last active
March 4, 2021 15:59
-
-
Save mb8z/caa6a6a133d62ca2c65e3bf93fbf8da7 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 { SMS } = require('automagically'); | |
const send = async () => { | |
// SMS with the same body | |
const sameBodySMS = await SMS.send({ | |
from: { phone: '+44500500500' }, | |
to: [ | |
{ phone: 'PHONE_NUMBER_1' }, | |
{ phone: 'PHONE_NUMBER_2' }, | |
], | |
body: 'Hello, world!', | |
}); | |
// SMS with different bodies | |
// PHONE_NUMBER_1 will receive "Hello, world!" message | |
// PHONE_NUMBER_2 will receive "Bye, world!" message | |
const differentBodySMS = await SMS.send({ | |
from: { phone: '+44500500500' }, | |
to: [ | |
{ phone: 'PHONE_NUMBER_1' }, | |
{ phone: 'PHONE_NUMBER_2', body: 'Bye, world!' }, | |
], | |
body: 'Hello, world!', | |
}); | |
}; | |
send(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment