forked from CCCHH/hedgedoc-expire
Improve email encoding
This commit is contained in:
parent
e0439dc667
commit
cecad168d0
1 changed files with 6 additions and 4 deletions
|
@ -229,10 +229,12 @@ class HedgedocExpire:
|
||||||
|
|
||||||
The admin team for {self.config.url}
|
The admin team for {self.config.url}
|
||||||
|
|
||||||
''')))
|
'''), 'plain', 'utf-8'))
|
||||||
md = MIMEBase('text', 'markdown')
|
md = MIMEText(note["content"], 'markdown', 'utf-8')
|
||||||
md.add_header('Content-Disposition', f'attachment; filename={note["title"]}.md')
|
filename = note['title'].encode('ascii', 'ignore').decode('utf-8')
|
||||||
md.set_payload(note["content"].encode(encoding='utf-8'))
|
if len(filename) == 0:
|
||||||
|
filename = 'note'
|
||||||
|
md.add_header('Content-Disposition', f'attachment; filename={filename}.md')
|
||||||
msg.attach(md)
|
msg.attach(md)
|
||||||
self.email_sender.send(msg)
|
self.email_sender.send(msg)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue