mirror of
https://github.com/pretix/pretix.git
synced 2026-04-25 23:42:32 +00:00
Compare commits
1 Commits
position-a
...
outgoingma
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bbdcf343f5 |
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
<dl class="dl-horizontal">
|
<dl class="dl-horizontal">
|
||||||
<dt>{% trans "From" context "email" %}</dt>
|
<dt>{% trans "From" context "email" %}</dt>
|
||||||
<dd>{{ mail.sender }}</dd>
|
<dd>{{ sender }}</dd>
|
||||||
<dt>{% trans "To" context "email" %}</dt>
|
<dt>{% trans "To" context "email" %}</dt>
|
||||||
<dd>{{ mail.to|join:", " }}</dd>
|
<dd>{{ mail.to|join:", " }}</dd>
|
||||||
{% if mail.cc %}
|
{% if mail.cc %}
|
||||||
|
|||||||
@@ -21,6 +21,8 @@
|
|||||||
#
|
#
|
||||||
import base64
|
import base64
|
||||||
import logging
|
import logging
|
||||||
|
from email.header import decode_header, make_header
|
||||||
|
from email.utils import parseaddr
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.contrib import messages
|
from django.contrib import messages
|
||||||
@@ -124,6 +126,12 @@ class OutgoingMailDetailView(OrganizerDetailViewMixin, OrganizerPermissionRequir
|
|||||||
ctx = super().get_context_data(**kwargs)
|
ctx = super().get_context_data(**kwargs)
|
||||||
if self.object.body_html:
|
if self.object.body_html:
|
||||||
ctx['data_url'] = "data:text/html;charset=utf-8;base64," + base64.b64encode(self.object.body_html.encode()).decode()
|
ctx['data_url'] = "data:text/html;charset=utf-8;base64," + base64.b64encode(self.object.body_html.encode()).decode()
|
||||||
|
|
||||||
|
from_name, from_email = parseaddr(self.object.sender)
|
||||||
|
if from_name:
|
||||||
|
from_name = make_header(decode_header(from_name))
|
||||||
|
ctx['sender'] = "{} <{}>".format(from_name, from_email) if from_name else from_email
|
||||||
|
|
||||||
return ctx
|
return ctx
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user