Add option for threaded newsletter emails

This commit is contained in:
JonnyWong16 2018-07-29 10:28:34 -07:00
parent 1b216a35d4
commit 0821c14aae
5 changed files with 66 additions and 10 deletions

View file

@ -1302,13 +1302,20 @@ class EMAIL(Notifier):
msg.replace_header('Content-Transfer-Encoding', 'quoted-printable')
msg.set_payload(body, 'utf-8')
msg['Message-ID'] = email.utils.make_msgid()
msg_id = kwargs.get('msg_id', email.utils.make_msgid())
reply_msg_id = kwargs.get('reply_msg_id')
msg['Message-ID'] = msg_id
msg['Date'] = email.utils.formatdate(localtime=True)
msg['Subject'] = subject
msg['From'] = email.utils.formataddr((self.config['from_name'], self.config['from']))
msg['To'] = ','.join(self.config['to'])
msg['CC'] = ','.join(self.config['cc'])
if reply_msg_id:
msg["In-Reply-To"] = reply_msg_id
msg["References"] = reply_msg_id
recipients = self.config['to'] + self.config['cc'] + self.config['bcc']
mailserver = None