diff options
author | Sebastian Reichel <sre@ring0.de> | 2012-05-27 22:10:51 +0200 |
---|---|---|
committer | Sebastian Reichel <sre@ring0.de> | 2012-05-27 22:10:51 +0200 |
commit | 8e221e224b15f7c77eb4c3bccc6325dea61a14d7 (patch) | |
tree | ded5f0793aa4ec49f31d3c0faa726f8b72359e45 /invoice | |
parent | dae41ebfe3c9571983ae7560c276063008d30b13 (diff) | |
download | serial-barcode-scanner-8e221e224b15f7c77eb4c3bccc6325dea61a14d7.tar.bz2 |
support sending mail without pdf attachment
Diffstat (limited to 'invoice')
-rwxr-xr-x | invoice/generate-invoice.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/invoice/generate-invoice.py b/invoice/generate-invoice.py index eb6c07e..3ac65b2 100755 --- a/invoice/generate-invoice.py +++ b/invoice/generate-invoice.py @@ -135,9 +135,10 @@ def generate_mail(receiver, subject, message, pdfdata, cc = None): msg.attach(MIMEText(message, 'plain', 'utf-8')) - pdf = MIMEApplication(pdfdata, 'pdf') - pdf.add_header('Content-Disposition', 'attachment', filename = 'rechnung.pdf') - msg.attach(pdf) + if pdfdata is not None: + pdf = MIMEApplication(pdfdata, 'pdf') + pdf.add_header('Content-Disposition', 'attachment', filename = 'rechnung.pdf') + msg.attach(pdf) return msg @@ -196,4 +197,13 @@ def daily(timestamp = time.time()): else: print("Can't send invoice for missing user with the following id:", user) +def monthly(timestamp = time.time()): + print("monthly invoice()") + +def backup(timestamp = time.time()): + print("backup()") + +def stock(timestamp = time.time()): + print("stock()") + daily() |