-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexamples.py
25 lines (21 loc) · 711 Bytes
/
examples.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
#!/usr/bin/env python3
import emails
import os
import reports
table_data=[
['Name', 'Amount', 'Value'],
['elderberries', 10, 0.45],
['figs', 5, 3],
['apples', 4, 2.75],
['durians', 1, 25],
['bananas', 5, 1.99],
['cherries', 23, 5.80],
['grapes', 13, 2.48],
['kiwi', 4, 0.49]]
reports.generate("/tmp/report.pdf", "A Complete Inventory of My Fruit", "This is all my fruit.", table_data)
sender = "automation@example.com"
receiver = "{}@example.com".format(os.environ.get('USER'))
subject = "List of Fruits"
body = "Hi\n\nI'm sending an attachment with all my fruit."
message = emails.generate(sender, receiver, subject, body, "/tmp/report.pdf")
emails.send(message)