Skip to content

Commit

Permalink
Revert "Use Security.render_template in mails too (#35)" (#47)
Browse files Browse the repository at this point in the history
This reverts commit 0a1dcf3.
  • Loading branch information
jwag956 committed Apr 30, 2019
1 parent 432a149 commit d5caf9e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions flask_security/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
from contextlib import contextmanager
from datetime import timedelta

from flask import current_app, flash, request, session, url_for
from flask import current_app, flash, render_template, request, session, \
url_for
from flask_login import login_user as _login_user
from flask_login import logout_user as _logout_user
from flask_mail import Message
Expand Down Expand Up @@ -392,9 +393,9 @@ def send_mail(subject, recipient, template, **context):

ctx = ('security/email', template)
if config_value('EMAIL_PLAINTEXT'):
msg.body = _security.render_template('%s/%s.txt' % ctx, **context)
msg.body = render_template('%s/%s.txt' % ctx, **context)
if config_value('EMAIL_HTML'):
msg.html = _security.render_template('%s/%s.html' % ctx, **context)
msg.html = render_template('%s/%s.html' % ctx, **context)

if _security._send_mail_task:
_security._send_mail_task(msg)
Expand Down

0 comments on commit d5caf9e

Please sign in to comment.