|
1 | 1 | import unicodedata
|
2 | 2 |
|
3 |
| -from bolt import forms, jinja |
| 3 | +from bolt import forms |
4 | 4 | from bolt.auth import authenticate, get_user_model, password_validation
|
5 | 5 | from bolt.auth.models import User
|
6 | 6 | from bolt.auth.tokens import default_token_generator
|
7 | 7 | from bolt.db.forms import ModelForm
|
8 | 8 | from bolt.exceptions import ValidationError
|
9 | 9 | from bolt.mail import EmailMultiAlternatives
|
| 10 | +from bolt.templates import Template |
10 | 11 | from bolt.utils.encoding import force_bytes
|
11 | 12 | from bolt.utils.http import urlsafe_base64_encode
|
12 | 13 |
|
@@ -279,16 +280,16 @@ def send_mail(
|
279 | 280 | """
|
280 | 281 | Send a bolt.mail.EmailMultiAlternatives to `to_email`.
|
281 | 282 | """
|
282 |
| - template = jinja.environment.from_string(subject_template_name) |
| 283 | + template = Template(subject_template_name) |
283 | 284 | subject = template.render(context)
|
284 | 285 | # Email subject *must not* contain newlines
|
285 | 286 | subject = "".join(subject.splitlines())
|
286 |
| - template = jinja.environment.from_string(email_template_name) |
| 287 | + template = Template(email_template_name) |
287 | 288 | body = template.render(context)
|
288 | 289 |
|
289 | 290 | email_message = EmailMultiAlternatives(subject, body, from_email, [to_email])
|
290 | 291 | if html_email_template_name is not None:
|
291 |
| - template = jinja.environment.from_string(html_email_template_name) |
| 292 | + template = Template(html_email_template_name) |
292 | 293 | html_email = template.render(context)
|
293 | 294 | email_message.attach_alternative(html_email, "text/html")
|
294 | 295 |
|
|
0 commit comments