|
@@ -5,6 +5,7 @@ import typing
|
5
|
5
|
from email.header import Header
|
6
|
6
|
from email.mime.multipart import MIMEMultipart
|
7
|
7
|
from email.mime.text import MIMEText
|
|
8
|
+from email.utils import formataddr
|
8
|
9
|
|
9
|
10
|
from lxml.html.diff import htmldiff
|
10
|
11
|
|
|
@@ -270,7 +271,12 @@ class EmailNotifier(object):
|
270
|
271
|
for role in notifiable_roles:
|
271
|
272
|
logger.info(self, 'Sending email to {}'.format(role.user.email))
|
272
|
273
|
to_addr = '{name} <{email}>'.format(name=role.user.display_name, email=role.user.email)
|
273
|
|
-
|
|
274
|
+ replyto_addr = self._global_config.EMAIL_NOTIFICATION_REPLY_TO_EMAIL.replace( # nopep8
|
|
275
|
+ '{content_id}',str(content.content_id)
|
|
276
|
+ )
|
|
277
|
+ reference_addr = self._global_config.EMAIL_NOTIFICATION_REFERENCES_EMAIL.replace( #nopep8
|
|
278
|
+ '{content_id}',str(content.content_id)
|
|
279
|
+ )
|
274
|
280
|
#
|
275
|
281
|
# INFO - D.A. - 2014-11-06
|
276
|
282
|
# We do not use .format() here because the subject defined in the .ini file
|
|
@@ -287,7 +293,9 @@ class EmailNotifier(object):
|
287
|
293
|
message['Subject'] = subject
|
288
|
294
|
message['From'] = self._get_sender(user)
|
289
|
295
|
message['To'] = to_addr
|
290
|
|
-
|
|
296
|
+ message['Reply-to'] = formataddr(('',replyto_addr))
|
|
297
|
+ message['References'] = formataddr(('',reference_addr))
|
|
298
|
+ # TODO: add correct header to allow reply
|
291
|
299
|
body_text = self._build_email_body(self._global_config.EMAIL_NOTIFICATION_CONTENT_UPDATE_TEMPLATE_TEXT, role, content, user)
|
292
|
300
|
|
293
|
301
|
|