initial commit

This commit is contained in:
Adam Rabjerg
2021-06-19 13:40:53 +02:00
commit f1faca41d1
7 changed files with 89 additions and 0 deletions

24
twilio_send.py Normal file
View File

@@ -0,0 +1,24 @@
#!/usr/bin/env python3
import os
from twilio.rest import Client
import configparser
config = configparser.ConfigParser()
config.read("secrets.env")
account_sid = config["TWILIO"]["account_sid"]
auth_token = config["TWILIO"]["auth_token"]
reciver_number = config["TWILIO"]["to_nr"]
sender_number = config["TWILIO"]["from_nr"]
client = Client(account_sid, auth_token)
def send_sms(payload):
message = client.messages \
.create(
body=payload,
from_=sender_number,
to=reciver_number
)
print(message.status)