-
Notifications
You must be signed in to change notification settings - Fork 0
/
notif.py
27 lines (25 loc) · 942 Bytes
/
notif.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
"""Notification Scripts"""
import setup # pylint: disable=unused-import, wrong-import-order
import http.client
import urllib
from params import Params
def new_order(order_number: int):
"""Send New Order Notification"""
conn = http.client.HTTPSConnection(Params.Pushover.server)
conn.request(
"POST",
"/1/messages.json",
urllib.parse.urlencode(
{
"token": Params.Pushover.apikey,
"user": Params.Pushover.orders_group,
"title": f"New Kumpe3D Order {order_number}",
"message": f"A new order has been submitted. The order number is {order_number}.",
"url": f"{Params.base_url}/packing_slip?order_id={order_number}",
"url_title": "View Packing Slip",
"sound": "aol",
}
),
{"Content-type": "application/x-www-form-urlencoded"},
)
conn.getresponse()