-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathemail_handler.py
22 lines (18 loc) · 975 Bytes
/
email_handler.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import requests
import time
def send_noTicketsFound_message():
return requests.post(
"https://api.mailgun.net/v3/mg.baileyberro.com/messages",
auth=("api", "key-e2fbc66c1bedbcd47649b34cbac6df55"),
"to": "Bailey <[email protected]>",
"subject": "Ticket Payment For " + time.strftime("%x"),
"text": "Congrats! There were no tickets found!"})
def send_TicketsFound_message(numTickets, totalCost):
return requests.post(
"https://api.mailgun.net/v3/mg.baileyberro.com/messages",
auth=("api", "key-e2fbc66c1bedbcd47649b34cbac6df55"),
"to": "Bailey <[email protected]>",
"subject": "Ticket Payment For " + time.strftime("%x"),
"text": "Paid " + numTickets + " tickets for a cost of " + totalCost })