From 8ef70bf066848d7d57ed18bd487c71883118c3ac Mon Sep 17 00:00:00 2001 From: flavis Date: Sat, 14 Sep 2019 22:49:33 +0200 Subject: [PATCH] use association emails in reply_to --- jdav_web/mailer/models.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jdav_web/mailer/models.py b/jdav_web/mailer/models.py index 94ea1b2..dc49fb3 100644 --- a/jdav_web/mailer/models.py +++ b/jdav_web/mailer/models.py @@ -72,13 +72,17 @@ class Message(models.Model): # remove any underscores from subject to prevent Arne from using # terrible looking underscores in subjects self.subject = self.subject.replace('_', ' ') + # generate message id message_id = "<{}@jdav-ludwigsburg.de>".format(self.pk) + # reply to adresses + reply_to = [jl.association_email for jl in self.reply_to.all()] try: success = send(self.subject, get_content(self.content), SENDING_ADDRESS, emails, message_id=message_id, - attachments=attach) + attachments=attach, + reply_to=reply_to) if success == SENT or success == PARTLY_SENT: self.sent = True for a in Attachment.objects.filter(msg__id=self.pk):