Need to send SMS to 11K people at once but don't know in advance how much $ to have in balance?

67 Views Asked by At

I have a python script which sends to all 11K people an SMS at once, they are from all sorts of countries. I don't want to have money left over in my balance as I won't be doing that again. Problem it's too difficult to estimate the cost as the people are from 190 different countries. I know there is Auto-recharge which is enabled for me, but the issue is that it's sending all messages at once, so I do not think auto-recharge will work as it needs to recharge inside milliseconds. Any solution?

1

There are 1 best solutions below

2
On

I'd try batching strategies, since most numbers can't process more than 10 SMS/second (1 SMS/second for NA numbers) anyhow (anything more will just get queued), so 11k messages would take ~18 mins anyhow.

So split your pool into 5 batches of ~2k messages, and see how much the first 3 batches cost, which would inform how much money to load for batches 4 & 5.

NOTE: running out of money mid-batch would need to be adequately handled, too.

Sending costs will vary by [destination] country, but these rates are published, e.g. US - 0.75 cents/msg, India - 1.75 cents/msg, UK - 4 cents/msg, etc.

Then the problem becomes one of parsing out country codes from your target numbers if they're not already split (e.g. +18005551234 vs. +1 8005551234).