<center>
<table style="{{ table_style }}">
<tbody><tr><td style="padding:20px;">
-<img src="{{ settings.APP_URL }}{{ settings.APP_LOGO }}" alt="{{settings.APP_TITLE}}" />
+<a href="{{ settings.APP_URL }}" style="border: 0;"><img src="{{ settings.APP_URL }}{{ settings.APP_LOGO }}" alt="{{settings.APP_TITLE}}" /></a>
<hr style="{{ hr_style }}" />
{% if not exclude_greeting %}
<p style="{{ p_style }}">{% trans "Hello" %} {{ recipient.username }},</p>
-{% extends "email_base.html" %}
-{% load i18n %}
-{% load extra_tags %}
-{% load email_tags %}
-
-{% block content %}
- <p>{% spaceless %}
- {% blocktrans with settings.APP_SHORT_NAME as site_title %}
- Hello, this is a {{site_title}} forum feedback message
- {% endblocktrans %}
- {% endspaceless %}</p>
-
- <p>
- {% trans "Sender" %}:
- {% if user.is_authenticated %}
- {{ user.username }} <br /> {% trans "email" %}:{{ user.email }}
- {% else %}
- {% if name %}{{ name }}{% else %}{% trans "anonymous" %}{% endif %}
- {% if email %}{% trans "email" %}:{{ email }}{% endif %}
- {% endif %}
- <br/>
- ip: {{ ip }}
- </p>
-
- <blockquote>
+{% load i18n extra_tags email_tags %}
+
+{% declare %}
+ prefix = settings.EMAIL_SUBJECT_PREFIX
+ app_name = settings.APP_SHORT_NAME
+
+ exclude_greeting = True
+ exclude_finetune = True
+{% enddeclare %}
+
+{% email %}
+ {% subject %}{% blocktrans %}{{ prefix }} Feedback message from {{ app_name }}{% endblocktrans %}{% endsubject %}
+
+ {% htmlcontent notifications/base.html %}
+ <p style="{{ p_style }}}">
+ {% trans "Sender" %}:
+ {% if user.is_authenticated %}
+ {{ user.username }} <br /> {% trans "email" %}:{{ user.email }}
+ {% else %}
+ {% if name %}{{ name }}{% else %}{% trans "anonymous" %}{% endif %}
+ {% if email %}{% trans "email" %}:{{ email }}{% endif %}
+ {% endif %}
+ <br/>
+ ip: {{ ip }}
+ </p>
+
+ <blockquote>
{% trans "Message body:" %} {{ message }}
- </blockquote>
+ </blockquote>
+
+ {% endhtmlcontent %}
+
+{% textcontent notifications/base_text.html %}
+{% if user.is_authenticated %}
+{% trans "Sender" %}: {{ user.username }}
+{% trans "email" %}: {{ user.email }}
+{% else %}
+{% trans "Sender" %}: {% if name %}{{ name }}{% else %}{% trans "anonymous" %}{% endif %}
+{% if email %}{% trans "email" %}: {{ email }}{% endif %}
+{% endif %}
+ip: {{ ip }}
+
+{% trans "Message body:" %} {{ message }}
+{% endtextcontent %}
+
+{% endemail %}
-{% endblock %}
{% textcontent notifications/base_text.html %}
{% blocktrans %}
-{{ newmember_name }} has just joined {{ app_name }}. You can visit {{ newmember_name }}'s profile using the following url: <br />
+{{ newmember_name }} has just joined {{ app_name }}. You can visit {{ newmember_name }}'s profile using the following url:
{{ app_url }}{{ newmember_url }}
{% endblocktrans %}
{% endtextcontent %}
from forum.models import Badge, Award, User
from forum.badges.base import BadgesMeta
from forum import settings
-from forum.utils.mail import send_email
+from forum.utils.mail import send_template_email
import re
def favicon(request):
context['name'] = form.cleaned_data.get('name',None)
context['ip'] = request.META['REMOTE_ADDR']
- recipients = [(adm.username, adm.email) for adm in User.objects.filter(is_superuser=True)]
-
- send_email(settings.EMAIL_SUBJECT_PREFIX + _("Feedback message from %(site_name)s") % {'site_name': settings.APP_SHORT_NAME},
- recipients, "notifications/feedback.html", context)
+ recipients = User.objects.filter(is_superuser=True)
+ send_template_email(recipients, "notifications/feedback.html", context)
msg = _('Thanks for the feedback!')
request.user.message_set.create(message=msg)