mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 05:22:16 +00:00
Update for premailer changed default
This commit is contained in:
@@ -13,6 +13,7 @@ from RIGS import models
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
# FIXME This needs a different implementation when moved off heroku
|
||||
help = 'Sends email reminders as required. Triggered daily through heroku-scheduler in production.'
|
||||
|
||||
def handle(self, *args, **options):
|
||||
@@ -33,6 +34,6 @@ class Command(BaseCommand):
|
||||
reply_to=[f"h.s.manager@{settings.DOMAIN}"],
|
||||
)
|
||||
css = finders.find('css/email.css')
|
||||
html = premailer.Premailer(get_template("email/ra_reminder.html").render(context), external_styles=css).transform()
|
||||
html = premailer.Premailer(get_template("email/ra_reminder.html").render(context), external_styles=css, allow_loading_external_files=True).transform()
|
||||
msg.attach_alternative(html, 'text/html')
|
||||
msg.send()
|
||||
|
||||
@@ -66,7 +66,7 @@ def send_eventauthorisation_success_email(instance):
|
||||
|
||||
css = finders.find('css/email.css')
|
||||
html = Premailer(get_template("email/eventauthorisation_client_success.html").render(context),
|
||||
external_styles=css).transform()
|
||||
external_styles=css, allow_loading_external_files=True).transform()
|
||||
client_email.attach_alternative(html, 'text/html')
|
||||
|
||||
escapedEventName = re.sub(r'[^a-zA-Z0-9 \n\.]', '', instance.event.name)
|
||||
@@ -124,7 +124,7 @@ def send_admin_awaiting_approval_email(user, request, **kwargs):
|
||||
)
|
||||
css = finders.find('css/email.css')
|
||||
html = Premailer(get_template("email/admin_awaiting_approval.html").render(context),
|
||||
external_styles=css).transform()
|
||||
external_styles=css, allow_loading_external_files=True).transform()
|
||||
email.attach_alternative(html, 'text/html')
|
||||
email.send()
|
||||
|
||||
|
||||
@@ -360,7 +360,7 @@ class EventAuthorisationRequest(generic.FormView, generic.detail.SingleObjectMix
|
||||
)
|
||||
css = finders.find('css/email.css')
|
||||
html = premailer.Premailer(get_template("email/eventauthorisation_client_request.html").render(context),
|
||||
external_styles=css).transform()
|
||||
external_styles=css, allow_loading_external_files=True).transform()
|
||||
msg.attach_alternative(html, 'text/html')
|
||||
|
||||
msg.send()
|
||||
@@ -376,7 +376,7 @@ class EventAuthoriseRequestEmailPreview(generic.DetailView):
|
||||
css = finders.find('css/email.css')
|
||||
response = super().render_to_response(context, **response_kwargs)
|
||||
assert isinstance(response, HttpResponse)
|
||||
response.content = premailer.Premailer(response.rendered_content, external_styles=css).transform()
|
||||
response.content = premailer.Premailer(response.rendered_content, external_styles=css, allow_loading_external_files=True).transform()
|
||||
return response
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user