Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

twilio Add a bulkSMS function to extend the twilio API #143

Open
taylordowns2000 opened this issue Jul 14, 2021 · 0 comments
Open

twilio Add a bulkSMS function to extend the twilio API #143

taylordowns2000 opened this issue Jul 14, 2021 · 0 comments

Comments

@taylordowns2000
Copy link
Member

Currently, there's no simple way for a user to send SMSs in bulk via Twilio. In OpenFn, using the sendSMS function the code would be pretty darn clunky:

If we assume the initial state looks like this:

{
  "configuration": { ... },
  "data": {
    "recipients": [ 1, 2, 3, ... ]
  }
}

they could write something like:

each(
  dataPath('recipients'),
  sendSMS(state => state.data.recipients.map(r => ({
    body: 'blah blah blah',
    from: '+19148675309',
    to: r.phoneNumber  
  })))
);

but it's pretty clunky and we'd rather have a function which takes an array of objects with phone numbers and texts and attempts to enqueue an SMS to each of them, then reports back on the status of each in a user-friendly way.

I'd envision a signature like bulkSMS(from, template, toList) that automatically iterated through the toList array, maybe using some sort of template text. This is still nebulous, but I'm hoping that Gunjan might have some input on the desired signature and return here. An alternative to the above would be bulkSMS(messages) where each message in that messages array would need to contain from, to, and body keys. That might be the winner. 🤷

Take a look at how sendSMS is written for inspiration.

@mtuchi mtuchi transferred this issue from OpenFn/language-twilio Nov 15, 2022
@mtuchi mtuchi changed the title Add a bulkSMS function to extend the twilio API twilio Add a bulkSMS function to extend the twilio API Nov 15, 2022
@taylordowns2000 taylordowns2000 moved this to Icebox in v2 Feb 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Icebox
Development

No branches or pull requests

1 participant