summary refs log tree commit diff
path: root/synapse/push/mailer.py
diff options
context:
space:
mode:
authormcalinghee <mcalinghee.dev@gmail.com>2024-04-23 17:45:24 +0200
committerGitHub <noreply@github.com>2024-04-23 16:45:24 +0100
commitae181233aa4c296d5d973eedfc599145ac0d5918 (patch)
treea972be7d6af088d9296af3ba9787dd7d94b6ab8f /synapse/push/mailer.py
parentAdd an OSX prompt to manually configure icu4c. (#17069) (diff)
downloadsynapse-ae181233aa4c296d5d973eedfc599145ac0d5918.tar.xz
Send an email if the address is already bound to an user account (#16819)
Co-authored-by: Mathieu Velten <mathieu.velten@beta.gouv.fr>
Co-authored-by: Olivier D <odelcroi@gmail.com>
Diffstat (limited to 'synapse/push/mailer.py')
-rw-r--r--synapse/push/mailer.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/synapse/push/mailer.py b/synapse/push/mailer.py
index f1ffc8115f..7c15eb7440 100644
--- a/synapse/push/mailer.py
+++ b/synapse/push/mailer.py
@@ -205,6 +205,22 @@ class Mailer:
             template_vars,
         )
 
+    emails_sent_counter.labels("already_in_use")
+
+    async def send_already_in_use_mail(self, email_address: str) -> None:
+        """Send an email if the address is already bound to an user account
+
+        Args:
+            email_address: Email address we're sending to the "already in use" mail
+        """
+
+        await self.send_email(
+            email_address,
+            self.email_subjects.email_already_in_use
+            % {"server_name": self.hs.config.server.server_name, "app": self.app_name},
+            {},
+        )
+
     emails_sent_counter.labels("add_threepid")
 
     async def send_add_threepid_mail(