fix: minor inprovements
This commit is contained in:
parent
0d1c1878b1
commit
27902ac31c
1 changed files with 7 additions and 5 deletions
10
wichteln.py
10
wichteln.py
|
@ -8,6 +8,7 @@ buy presents for.
|
|||
from argparse import ArgumentParser
|
||||
from email.mime.multipart import MIMEMultipart
|
||||
from email.mime.text import MIMEText
|
||||
from email.utils import formatdate
|
||||
import json
|
||||
import random
|
||||
import smtplib
|
||||
|
@ -76,11 +77,12 @@ for r in participants:
|
|||
msg['From'] = config['sender']
|
||||
msg['To'] = r['mail']
|
||||
msg['Subject'] = 'Wichteln 🎄'
|
||||
msg['Date'] = formatdate(localtime=True)
|
||||
|
||||
body = 'Lieb'+r['gender']+' '+r['name']+'!'
|
||||
body += '\n\nDu bist heuer Wichtel für '+r['partner']
|
||||
body += '. \n Das Geschenk sollte nicht mehr als 50€ kosten.'
|
||||
body += '\nFrohe Weihnachten!\n\nDein Christkind 👼'
|
||||
body = 'Lieb'+r['gender']+' '+r['name']+'!\n\n'
|
||||
body += 'Du bist heuer Wichtel für '+r['partner']+'.\n'
|
||||
body += 'Das Geschenk sollte nicht mehr als 50€ kosten.\n\n'
|
||||
body += 'Frohe Weihnachten!\n— Dein Christkind 👼'
|
||||
|
||||
msg.attach(MIMEText(body, 'plain', 'utf-8'))
|
||||
server.sendmail(config['sender'], r['mail'], msg.as_string())
|
||||
|
|
Loading…
Reference in a new issue