Do not show subject prefix in HTML email headline

This commit is contained in:
Raphael Michel
2019-12-17 11:09:05 +01:00
parent 387e1b4998
commit 9f629fc1c9

View File

@@ -132,7 +132,7 @@ def mail(email: str, subject: str, template: Union[str, LazyI18nString],
else: else:
sender = formataddr((settings.PRETIX_INSTANCE_NAME, sender)) sender = formataddr((settings.PRETIX_INSTANCE_NAME, sender))
subject = str(subject) subject = raw_subject = str(subject)
signature = "" signature = ""
bcc = [] bcc = []
@@ -198,13 +198,13 @@ def mail(email: str, subject: str, template: Union[str, LazyI18nString],
try: try:
if 'position' in inspect.signature(renderer.render).parameters: if 'position' in inspect.signature(renderer.render).parameters:
body_html = renderer.render(content_plain, signature, str(subject), order, position) body_html = renderer.render(content_plain, signature, raw_subject, order, position)
else: else:
# Backwards compatibility # Backwards compatibility
warnings.warn('E-mail renderer called without position argument because position argument is not ' warnings.warn('E-mail renderer called without position argument because position argument is not '
'supported.', 'supported.',
DeprecationWarning) DeprecationWarning)
body_html = renderer.render(content_plain, signature, str(subject), order) body_html = renderer.render(content_plain, signature, raw_subject, order)
except: except:
logger.exception('Could not render HTML body') logger.exception('Could not render HTML body')
body_html = None body_html = None