Skip to content
This repository has been archived by the owner on Aug 26, 2022. It is now read-only.

Commit

Permalink
Merge pull request #3639 from robhudson/fix-welcome-email-2
Browse files Browse the repository at this point in the history
Bug 1217208 - Ensure we're using jingo when rendering emails
  • Loading branch information
groovecoder committed Nov 10, 2015
2 parents 998ddef + 6f9d531 commit d66f6c8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions kuma/users/tasks.py
Expand Up @@ -4,11 +4,11 @@
from django.conf import settings
from django.contrib.auth import get_user_model
from django.core.mail import EmailMultiAlternatives
from django.template.loader import render_to_string
from django.utils import translation
from django.utils.translation import ugettext_lazy as _
from djcelery_transactions import task as transaction_task

from kuma.core.email_utils import render_email
from kuma.core.utils import strings_are_translated


Expand All @@ -29,10 +29,10 @@ def send_welcome_email(user_pk, locale):
context = {'username': user.username}
log.debug('Using the locale %s to send the welcome email', locale)
with translation.override(locale):
content_plain = render_to_string('users/email/welcome/plain.ltxt',
context)
content_html = render_to_string('users/email/welcome/html.ltxt',
context)
content_plain = render_email('users/email/welcome/plain.ltxt',
context)
content_html = render_email('users/email/welcome/html.ltxt',
context)

email = EmailMultiAlternatives(
_('Take the next step to get involved on MDN!'),
Expand Down
2 changes: 1 addition & 1 deletion settings.py
Expand Up @@ -521,7 +521,7 @@ def JINJA_CONFIG():
# Details: http://jinja.pocoo.org/2/documentation/api#bytecode-cache
# and in the errors you get when you try it the other way.
bc = jinja2.MemcachedBytecodeCache(cache._cache,
"%s:j3:" % settings.CACHE_PREFIX)
"%s:j4:" % settings.CACHE_PREFIX)
config['cache_size'] = -1 # Never clear the cache
config['bytecode_cache'] = bc
return config
Expand Down

0 comments on commit d66f6c8

Please sign in to comment.