Created
April 24, 2022 17:59
-
-
Save souravs17031999/86b480d0cecc9bf87b40034bb9a1a9d7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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