-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmailgun.py
More file actions
30 lines (30 loc) · 786 Bytes
/
mailgun.py
File metadata and controls
30 lines (30 loc) · 786 Bytes
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
#import requests
#
#
#class MailgunApi:
# API_URL = 'https://api.mailgun.net/v3/{}/messages'
#
# def __init__(self, domain, api_key):
# self.domain = domain
# self.key = api_key
# self.base_url = self.API_URL.format(self.domain)
#
# def send_email(self, to, subject, text, html=None):
# if not isinstance(to, (list, tuple)):
# to = [to, ]
#
# data = {
# 'from': 'Gym-Planner <no-reply@{}>'.format(self.domain),
# 'to': to,
# 'subject': subject,
# 'text': text,
# 'html': html
#
# }
#
# response = requests.post(url=self.base_url,
# auth=('api', self.key),
# data=data)
#
# return response
#