diff options
author | mcalinghee <mcalinghee.dev@gmail.com> | 2024-04-23 17:45:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-23 16:45:24 +0100 |
commit | ae181233aa4c296d5d973eedfc599145ac0d5918 (patch) | |
tree | a972be7d6af088d9296af3ba9787dd7d94b6ab8f /synapse/push | |
parent | Add an OSX prompt to manually configure icu4c. (#17069) (diff) | |
download | synapse-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')
-rw-r--r-- | synapse/push/mailer.py | 16 |
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( |