Skip to content

Commit

Permalink
feat(partnership): set password email template (#86366)
Browse files Browse the repository at this point in the history
Currently for partnerships, when a new account was created we were
sending recover account email asking users to set their password. Half
of the logic needed to send another email was done, but it was never
finished.

Now we have a new email template where we ask user to set their password
upon account creation

---------

Co-authored-by: Fabian Schindler <fabian.schindler@sentry.io>
  • Loading branch information
vgrozdanic and constantinius authored Mar 5, 2025
1 parent 0112821 commit f34ac45
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/sentry/templates/sentry/emails/set_password.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{% extends "sentry/emails/base.html" %}

{% load i18n %}

{% block main %}
<p>Welcome to Sentry. We created your account, you just need to set a password and you'll be all set.</p>

<p><a href="{{ url|safe }}" class="btn">Set your Password</a></p>

<p>Once you are in, you can:</p>
<ul>
<li>Monitor your code in production</li>
<li>Get realtime notifications for errors and latency problems</li>
<li>Have all the context to debug critical issues</li>
</ul>

<p>If you weren't expecting this email, please ignore it.</p>

<p>The Sentry Team</p>
{% endblock %}
12 changes: 12 additions & 0 deletions src/sentry/templates/sentry/emails/set_password.txt
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions src/sentry/users/models/lostpasswordhash.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down

0 comments on commit f34ac45

Please sign in to comment.