-
Notifications
You must be signed in to change notification settings - Fork 0
/
message.py
40 lines (32 loc) · 1.41 KB
/
message.py
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
def vmessage(body,vphone):
from twilio.rest import Client
# Your Account Sid and Auth Token from twilio.com / console
account_sid = 'Axxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
auth_token = 'bxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
client = Client(account_sid, auth_token)
''' Change the value of 'from' with the number
received from Twilio and the value of 'to'
with the number in which you want to send message.'''
message = client.messages.create(
from_='mobile no.',
body =body,
to = str(vphone)
)
print("Message sent to the visitor")
return 0
def hmessage(body,hphone):
from twilio.rest import Client
# Your Account Sid and Auth Token from twilio.com / console
account_sid = 'Axxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
auth_token = 'bxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
client = Client(account_sid, auth_token)
''' Change the value of 'from' with the number
received from Twilio and the value of 'to'
with the number in which you want to send message.'''
message = client.messages.create(
from_='+1*******68',
body = body,
to = str(hphone)
)
print("Message sent to the Host")
return 0