Added some email templates

This commit is contained in:
Fergal Moran
2013-05-03 14:48:59 +01:00
parent dc830b8a82
commit c8f5dd0467
6 changed files with 19 additions and 3 deletions

View File

@@ -261,8 +261,9 @@ mimetypes.add_type("text/xml", ".plist", False)
HTML_MINIFY = not localsettings.DEBUG
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'localhost'
EMAIL_PORT = 1025
EMAIL_HOST = localsettings.EMAIL_HOST
EMAIL_PORT = localsettings.EMAIL_PORT
if DEBUG:
import mimetypes

View File

@@ -89,7 +89,7 @@ class UserProfile(_BaseModel):
def add_follower(self, user):
self.followers.add(user)
try:
notification.send([self.user], "new_follower", {"from_user": "admin@deepsouthsounds.com"})
notification.send([self.user], "new_follower", {"profile": user})
except Exception, ex:
self.logger.warning("Unable to send email for new follower")
self.logger.warning("Host: %s" % settings.EMAIL_HOST)

View File

@@ -0,0 +1,6 @@
{% load i18n %}{% load url from future %}{% url "notification_notices" as notices_url %}{% blocktrans %}You have received the following notice from {{ current_site }}:
{{ message }}
To see other notices change how you receive notifications, please go to {{ default_http_protocol }}://{{ current_site }}/me
{% endblocktrans %}

View File

@@ -0,0 +1 @@
<a href="{{ profile.get_absolute_url }}">{{ profile.get_nice_name }}</a> has started following you.

View File

@@ -0,0 +1,7 @@
{% load i18n %}
{% url invitations as invitation_page %}
{% url profile_detail username=invitation.from_user.username as user_url %}
{% blocktrans with invitation.from_user as invitation_from_user %}
<a href="{{ user_url }}">{{ invitation_from_user }}</a> has started following you on Deep South Sounds
(see <a href="{{ invitation_page }}">followers</a>)
{% endblocktrans %}

View File

@@ -0,0 +1 @@
{% load i18n %}{% blocktrans %}{{ notice }}{% endblocktrans %}