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?
Asked
Active
Viewed 49 times
1 Answers
1
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).

Adam Smooch
- 1,167
- 1
- 12
- 27
-
I like your strategy. I will do that. Thanks. I did not undertstand the last paragraph you wrote though, could you explain differently? – Yaakov Unger Sep 05 '21 at 20:22
-
Thanks for the feedback - I’ve updated the last paragraph with more concrete examples! – Adam Smooch Sep 06 '21 at 13:32