mirror of
https://github.com/fergalmoran/bitchmin.git
synced 2026-01-06 08:46:06 +00:00
17 lines
400 B
Python
17 lines
400 B
Python
from twilio.rest import Client
|
|
import os
|
|
import logging
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
def send_sms(number_to, number_from, message):
|
|
client = Client(os.getenv('TWILIO_ACCOUNT_SID'), os.getenv('TWILIO_AUTH_TOKEN'))
|
|
logger.debug('Sending SMS')
|
|
message = client.messages.create(
|
|
to=number_to,
|
|
from_=number_from,
|
|
body=message
|
|
)
|
|
logger.debug(message)
|