diff --git a/src/sentry/templates/sentry/emails/set_password.html b/src/sentry/templates/sentry/emails/set_password.html new file mode 100644 index 00000000000000..d5fa2e61ea121d --- /dev/null +++ b/src/sentry/templates/sentry/emails/set_password.html @@ -0,0 +1,20 @@ +{% extends "sentry/emails/base.html" %} + +{% load i18n %} + +{% block main %} +
Welcome to Sentry. We created your account, you just need to set a password and you'll be all set.
+ + + +Once you are in, you can:
+If you weren't expecting this email, please ignore it.
+ +The Sentry Team
+{% endblock %} diff --git a/src/sentry/templates/sentry/emails/set_password.txt b/src/sentry/templates/sentry/emails/set_password.txt new file mode 100644 index 00000000000000..23b94bc2c50c88 --- /dev/null +++ b/src/sentry/templates/sentry/emails/set_password.txt @@ -0,0 +1,12 @@ +Welcome to Sentry. We created your account, you just need to set a password and you'll be all set. + +{{ url|safe }} + +Once you are in, you can: +- Monitor your code in production +- Get realtime notifications for errors and latency problems +- Have all the context to debug critical issues + +If you weren't expecting this email, please ignore it. + +The Sentry Team diff --git a/src/sentry/users/models/lostpasswordhash.py b/src/sentry/users/models/lostpasswordhash.py index f6c98a98204e50..5d07da83c86f56 100644 --- a/src/sentry/users/models/lostpasswordhash.py +++ b/src/sentry/users/models/lostpasswordhash.py @@ -58,6 +58,10 @@ def send_relocate_account_email( ) -> None: cls._send_email("relocate_account", user, hash, {"orgs": orgs}) + @classmethod + def send_set_password_email(cls, user: User | RpcUser, hash: str, **kwargs: Any) -> None: + cls._send_email("set_password", user, hash, extra=kwargs) + @classmethod def _send_email(cls, mode: str, user: User | RpcUser, hash: str, extra: dict[str, Any]) -> None: from sentry import options @@ -75,6 +79,7 @@ def _send_email(cls, mode: str, user: User | RpcUser, hash: str, extra: dict[str subject = "Password Recovery" template = "recover_account" if mode == "set_password": + subject = "Set Password for your Sentry.io Account" template = "set_password" elif mode == "relocate_account": template = "relocate_account"