summary refs log tree commit diff
path: root/synapse/push/mailer.py
diff options
context:
space:
mode:
authorMatthew Hodgson <matthew@arasphere.net>2016-06-03 12:15:01 +0100
committerMatthew Hodgson <matthew@arasphere.net>2016-06-03 12:15:01 +0100
commitaa6fab0cc2c875f1a692c3dd83f62a7f81dbefd8 (patch)
tree5034a5aba0c6e604683080357ae6481803a4dea1 /synapse/push/mailer.py
parentMerge branch 'erikj/cache_perf' of github.com:matrix-org/synapse into develop (diff)
parentMerge branch 'develop' into matthew/brand-from-header (diff)
downloadsynapse-aa6fab0cc2c875f1a692c3dd83f62a7f81dbefd8.tar.xz
Merge pull request #822 from matrix-org/matthew/brand-from-header
brand the email from header
Diffstat (limited to 'synapse/push/mailer.py')
-rw-r--r--synapse/push/mailer.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/synapse/push/mailer.py b/synapse/push/mailer.py
index c3431cdbf2..88402e42a6 100644
--- a/synapse/push/mailer.py
+++ b/synapse/push/mailer.py
@@ -99,7 +99,14 @@ class Mailer(object):
     @defer.inlineCallbacks
     def send_notification_mail(self, app_id, user_id, email_address,
                                push_actions, reason):
-        raw_from = email.utils.parseaddr(self.hs.config.email_notif_from)[1]
+        try:
+            from_string = self.hs.config.email_notif_from % {
+                "app": self.app_name
+            }
+        except TypeError:
+            from_string = self.hs.config.email_notif_from
+
+        raw_from = email.utils.parseaddr(from_string)[1]
         raw_to = email.utils.parseaddr(email_address)[1]
 
         if raw_to == '':