Skip to content

Instantly share code, notes, and snippets.

@mb8z
Last active March 4, 2021 15:59
Show Gist options
  • Save mb8z/caa6a6a133d62ca2c65e3bf93fbf8da7 to your computer and use it in GitHub Desktop.
Save mb8z/caa6a6a133d62ca2c65e3bf93fbf8da7 to your computer and use it in GitHub Desktop.
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