Skip to content

Instantly share code, notes, and snippets.

@souravs17031999
Created April 24, 2022 17:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save souravs17031999/86b480d0cecc9bf87b40034bb9a1a9d7 to your computer and use it in GitHub Desktop.
Save souravs17031999/86b480d0cecc9bf87b40034bb9a1a9d7 to your computer and use it in GitHub Desktop.
def send_twilio_notifications(message_body):
try:
print("[TWILIO] : sending SMS to user ")
print("[TWILIO] : message for SMS: ")
print(message_body)
message = client.messages.create(
body=message_body,
from_=TWILIO_PHONE_USER_SENDER,
to=TWILIO_PHONE_USER_RECEIVER
)
print(message.sid)
print("[TWILIO]: Message (SMS) send successfully !")
except Exception as e:
print(f"[ERROR]: {e}")
print(
"status: failure, message: SMS notifications sending to user failed !"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment