bookmyservice-ums / app /utils /sms_utils.py
MukeshKapoor25's picture
Add initial implementation of User Management Service
b407a42
raw
history blame
354 Bytes
from twilio.rest import Client
from app.core.config import settings
def send_sms_otp(phone: str, otp: str) -> str:
client = Client(settings.TWILIO_ACCOUNT_SID, settings.TWILIO_AUTH_TOKEN)
message = client.messages.create(
from_=settings.TWILIO_SMS_FROM,
body=f"Your OTP is {otp}",
to=phone
)
return message.sid