Inject user email in notification mail subjects astakos/v0.7.5
authorKostas Papadimitriou <kpap@grnet.gr>
Fri, 7 Sep 2012 15:52:55 +0000 (18:52 +0300)
committerKostas Papadimitriou <kpap@grnet.gr>
Fri, 7 Sep 2012 15:55:10 +0000 (18:55 +0300)
snf-astakos-app/Changelog
snf-astakos-app/astakos/im/functions.py
snf-astakos-app/astakos/im/settings.py
snf-astakos-app/conf/20-snf-astakos-app-settings.conf

index 85a6ced..7f6e33b 100644 (file)
@@ -1,6 +1,10 @@
 Changelog
 ---------
 
+v0.7.5
+^^^^^^
+- Include user email in registered/activated notification mails subject
+
 v0.7.4
 ^^^^^^
 - Configurable subjects for all emails send by astakos app. Introduced settings
index 8d3b6a1..f3fd438 100644 (file)
@@ -123,7 +123,7 @@ def send_admin_notification(user, template_name='im/admin_notification.txt'):
             'support': DEFAULT_CONTACT_EMAIL})
     sender = DEFAULT_FROM_EMAIL
     try:
-        send_mail(_(ADMIN_NOTIFICATION_EMAIL_SUBJECT), message, sender, [DEFAULT_ADMIN_EMAIL])
+        send_mail(_(ADMIN_NOTIFICATION_EMAIL_SUBJECT) % {'user': user.email}, message, sender, [DEFAULT_ADMIN_EMAIL])
     except (SMTPException, socket.error) as e:
         logger.exception(e)
         raise SendNotificationError()
@@ -146,7 +146,7 @@ def send_helpdesk_notification(user, template_name='im/helpdesk_notification.txt
             'support': DEFAULT_ADMIN_EMAIL})
     sender = DEFAULT_FROM_EMAIL
     try:
-        send_mail(_(HELPDESK_NOTIFICATION_EMAIL_SUBJECT), message, sender, [DEFAULT_CONTACT_EMAIL])
+        send_mail(_(HELPDESK_NOTIFICATION_EMAIL_SUBJECT) % {'user': user.email}, message, sender, [DEFAULT_CONTACT_EMAIL])
     except (SMTPException, socket.error) as e:
         logger.exception(e)
         raise SendNotificationError()
index 6196c62..fc7a44a 100644 (file)
@@ -110,9 +110,9 @@ FEEDBACK_EMAIL_SUBJECT = getattr(settings, 'ASTAKOS_FEEDBACK_EMAIL_SUBJECT',
 VERIFICATION_EMAIL_SUBJECT = getattr(settings, 'ASTAKOS_VERIFICATION_EMAIL_SUBJECT',
         '%s alpha2 testing account activation is needed' % SITENAME)
 ADMIN_NOTIFICATION_EMAIL_SUBJECT = getattr(settings, 'ASTAKOS_ADMIN_NOTIFICATION_EMAIL_SUBJECT',
-        '%s alpha2 testing account notification' % SITENAME)
+        '%s alpha2 testing account created (%%(user)s)' % SITENAME)
 HELPDESK_NOTIFICATION_EMAIL_SUBJECT = getattr(settings, 'ASTAKOS_HELPDESK_NOTIFICATION_EMAIL_SUBJECT',
-        '%s alpha2 testing account notification' % SITENAME)
+        '%s alpha2 testing account activated (%%(user)s)' % SITENAME)
 EMAIL_CHANGE_EMAIL_SUBJECT = getattr(settings, 'ASTAKOS_EMAIL_CHANGE_EMAIL_SUBJECT',
         'Email change on %s alpha2 testing' % SITENAME)
 PASSWORD_RESET_EMAIL_SUBJECT = getattr(settings, 'ASTAKOS_PASSWORD_RESET_EMAIL_SUBJECT',
index 9e6027b..9a138bf 100644 (file)
 #from logging import INFO
 #ASTAKOS_LOGGING_LEVEL = INFO
 
+# Email subjects configuration. For admin/helper notification emails %(user)s 
+# maps to registered/activated user email.
 #ASTAKOS_INVITATION_EMAIL_SUBJECT = 'Invitation to %s alpha2 testing' % SITENAME
 #ASTAKOS_GREETING_EMAIL_SUBJECT = 'Welcome to %s alpha2 testing' % SITENAME
 #ASTAKOS_FEEDBACK_EMAIL_SUBJECT = 'Feedback from %s alpha2 testing' % SITENAME
 #ASTAKOS_VERIFICATION_EMAIL_SUBJECT = '%s alpha2 testing account activation is needed' % SITENAME
-#ASTAKOS_ADMIN_NOTIFICATION_EMAIL_SUBJECT = '%s alpha2 testing account notification' % SITENAME
-#ASTAKOS_HELPDESK_NOTIFICATION_EMAIL_SUBJECT = '%s alpha2 testing account notification' % SITENAME
+#ASTAKOS_ADMIN_NOTIFICATION_EMAIL_SUBJECT = '%s alpha2 testing account created (%%(user)s)' % SITENAME
+#ASTAKOS_HELPDESK_NOTIFICATION_EMAIL_SUBJECT = '%s alpha2 testing account activated (%%(user)s)' % SITENAME
 #ASTAKOS_EMAIL_CHANGE_EMAIL_SUBJECT = 'Email change on %s alpha2 testing' % SITENAME
 #ASTAKOS_PASSWORD_RESET_EMAIL_SUBJECT = 'Password reset on %s alpha2 testing' % SITENAME
+