I send SMS alerts to my mobile phone using Twilio; I would like to route this to a different number based on a schedule / rota? ie I am in the US, so during my day I would like to get alerts, and then during the UK's day I would like someone else?
Any ideas?
Thanks
You can just configure the sending address based on the current date and time. In Python this would look something like this:
from datetime import datetime
curr_time = datetime.utcnow()
# roughly, London working hours
if 8 < curr_time.hour <= 17:
recipient = "+44XXXXXXXXXXX"
else:
recipient = "+1XXXXXXXXXXXX"
send_sms_message(from=twilio_number, to=recipient, body=body)
Without knowing more about how you are sending the messages, or how you are generating alerts, it's difficult to provide a more nuanced answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With