-{% load i18n extra_tags email_tags %}\r
-\r
-{% declare %}\r
- prefix = settings.EMAIL_SUBJECT_PREFIX\r
- app_name = settings.APP_SHORT_NAME\r
- app_url = settings.APP_URL\r
- answer_author = answer.author.username\r
- question = answer.question\r
- question_url = question.get_absolute_url()\r
- question_title = question.title\r
- accepted_by = answer.nstate.accepted.by.username\r
-{% enddeclare %}\r
-\r
-{% email %}\r
- {% subject %}{% blocktrans %}{{ prefix }} New answer to {{ question_title }}{% endblocktrans %}{% endsubject %}\r
-\r
- {% htmlcontent notifications/base.html %}\r
- <p style="{{ p_style }}">\r
- {% blocktrans %}\r
- {{ accepted_by }} has just accepted {{ answer_author }}'s answer on his question\r
- <a href="{{ app_url }}{{ question_url }}">{{ question_title }}</a>.\r
- {% endblocktrans %}\r
- </p>\r
- {% endhtmlcontent %}\r
-\r
- {% textcontent notifications/base_text.html %}\r
- {% blocktrans %}\r
- {{ accepted_by }} has just accepted {{ answer_author }}'s answer on his question\r
- "{{ question_title }}".\r
- {% endblocktrans %}\r
- {% endtextcontent %}\r
-\r
-{% endemail %}\r
+{% load i18n extra_tags email_tags %}
+
+{% declare %}
+ prefix = html.mark_safe(smart_str(settings.EMAIL_SUBJECT_PREFIX))
+ answer_author = html.mark_safe(smart_str(answer.author.username))
+ question = answer.question
+ question_title = html.mark_safe(smart_str(question.title))
+ accepted_by = html.mark_safe(smart_str(answer.nstate.accepted.by.username))
+ accepted_by_link = html.objlink(answer.nstate.accepted.by, style=settings.EMAIL_ANCHOR_STYLE)
+ answer_author_link = html.objlink(answer.author, style=settings.EMAIL_ANCHOR_STYLE)
+ question_link = html.objlink(question, style=settings.EMAIL_ANCHOR_STYLE)
+{% enddeclare %}
+
+{% email %}
+ {% subject %}{% blocktrans %}{{ prefix }} An answer to: {{ question_title }} has been accepted{% endblocktrans %}{% endsubject %}
+
+ {% htmlcontent notifications/base.html %}
+ <p style="{{ p_style }}">
+ {% blocktrans %}
+ {{ accepted_by_link }} has just accepted {{ answer_author_link }}'s answer on his question
+ {{ question_link }}.
+ {% endblocktrans %}
+ </p>
+ {% endhtmlcontent %}
+
+{% textcontent notifications/base_text.html %}
+{% blocktrans %}
+{{ accepted_by }} has just accepted {{ answer_author }}'s answer on his question
+"{{ question_title }}".
+{% endblocktrans %}
+{% endtextcontent %}
+
+{% endemail %}