-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_twilio.py
More file actions
26 lines (20 loc) · 813 Bytes
/
Copy pathtest_twilio.py
File metadata and controls
26 lines (20 loc) · 813 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import os
from dotenv import load_dotenv
from app.services.twilio_service import TwilioService
# Load environment variables
load_dotenv()
def test_twilio():
"""Test Twilio WhatsApp integration"""
# Initialize Twilio service
twilio_service = TwilioService()
# Get phone number from user input
phone_number = input("Enter your WhatsApp phone number (with country code, e.g., +1234567890): ")
# Send a test message
message = "Hello! This is a test message from the AI-Powered Scheduling Bot."
try:
message_sid = twilio_service.send_whatsapp_message(phone_number, message)
print(f"Message sent successfully! SID: {message_sid}")
except Exception as e:
print(f"Error sending message: {str(e)}")
if __name__ == '__main__':
test_twilio()