Skip to content

Commit

Permalink
Merge pull request #16 from aplbrain/9-update-email-sent-to-new-users
Browse files Browse the repository at this point in the history
EMBER-ify emails. Fix admin email
  • Loading branch information
sandyhider authored Feb 18, 2025
2 parents 582f789 + 6e93282 commit 3dbb29a
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 33 deletions.
14 changes: 7 additions & 7 deletions dandiapi/api/mail.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
}

# TODO: turn this into a Django setting
ADMIN_EMAIL = '[email protected]'
ADMIN_EMAIL = '[email protected]'


def user_greeting_name(user: User, socialaccount: SocialAccount = None) -> str:
Expand Down Expand Up @@ -100,7 +100,7 @@ def send_ownership_change_emails(dandiset, removed_owners, added_owners):
def build_registered_message(user: User, socialaccount: SocialAccount):
# Email sent to the DANDI list when a new user logs in for the first time
return build_message(
subject=f'DANDI: New user registered: {user.email}',
subject=f'EMBER-DANDI: New user registered: {user.email}',
message=render_to_string(
'api/mail/registered_message.txt',
{'greeting_name': user_greeting_name(user, socialaccount)},
Expand All @@ -123,7 +123,7 @@ def build_new_user_messsage(user: User, socialaccount: SocialAccount = None):
}
# Email sent to the DANDI list when a new user logs in for the first time
return build_message(
subject=f'DANDI: Review new user: {user.username}',
subject=f'EMBER-DANDI: Review new user: {user.username}',
message=render_to_string('api/mail/new_user_message.txt', render_context),
to=[ADMIN_EMAIL],
)
Expand All @@ -138,7 +138,7 @@ def send_new_user_message_email(user: User, socialaccount: SocialAccount):

def build_approved_user_message(user: User, socialaccount: SocialAccount = None):
return build_message(
subject='Your DANDI Account',
subject='Your EMBER-DANDI Account',
message=render_to_string(
'api/mail/approved_user_message.txt',
{
Expand All @@ -159,7 +159,7 @@ def send_approved_user_message(user: User, socialaccount: SocialAccount):

def build_rejected_user_message(user: User, socialaccount: SocialAccount = None):
return build_message(
subject='Your DANDI Account',
subject='Your EMBER-DANDI Account',
message=render_to_string(
'api/mail/rejected_user_message.txt',
{
Expand All @@ -181,7 +181,7 @@ def send_rejected_user_message(user: User, socialaccount: SocialAccount):
def build_pending_users_message(users: Iterable[User]):
render_context = {**BASE_RENDER_CONTEXT, 'users': users}
return build_message(
subject='DANDI: new user registrations to review',
subject='EMBER-DANDI: new user registrations to review',
message=render_to_string('api/mail/pending_users_message.txt', render_context),
to=[ADMIN_EMAIL],
)
Expand Down Expand Up @@ -228,7 +228,7 @@ def build_dandiset_unembargo_failed_message(dandiset: Dandiset):
render_context = {**BASE_RENDER_CONTEXT, 'dandiset': dandiset_context}
html_message = render_to_string('api/mail/dandiset_unembargo_failed.html', render_context)
return build_message(
subject=f'DANDI: Unembargo failed for dandiset {dandiset.identifier}',
subject=f'EMBER-DANDI: Unembargo failed for dandiset {dandiset.identifier}',
message=strip_tags(html_message),
html_message=html_message,
to=[owner.email for owner in get_dandiset_owners(dandiset)],
Expand Down
4 changes: 2 additions & 2 deletions dandiapi/api/templates/api/account/questionnaire_form.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends 'api/account/base.html' %}

{% block body %}
<h5>Welcome to DANDI! Please take a moment to fill out this form.</h5>
<h5>Welcome to EMBER-DANDI! Please take a moment to fill out this form.</h5>
<h6><b>Note:</b> No account is necessary to access public data!</h6>
<form method="POST" class="col s12">
{% csrf_token %}
Expand Down Expand Up @@ -32,7 +32,7 @@ <h6><b>Note:</b> No account is necessary to access public data!</h6>
</div>
</form>
<div style="margin-top: 4%">
Contact us at <a href="mailto:[email protected]">[email protected]</a> if you have any questions.
Contact us at <a href="mailto:[email protected]">[email protected]</a> if you have any questions.
</div>

<script>
Expand Down
6 changes: 3 additions & 3 deletions dandiapi/api/templates/api/mail/approved_user_message.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% autoescape off %}
Dear {{ greeting_name }},

Your DANDI account has been approved. You can go to {{ dandi_web_app_url }} and login with your GitHub account
Your EMBER-DANDI account has been approved. You can go to {{ dandi_web_app_url }} and login with your GitHub account
to start creating dandisets and uploading data.

Please use the following links to post any questions or issues.
Expand All @@ -12,9 +12,9 @@ Issues: https://github.com/dandi/helpdesk/issues/new/choose
YouTube: https://www.youtube.com/@dandiarchive
(please Subscribe)

Thank you for choosing DANDI for your neurophysiology data needs.
Thank you for choosing EMBER-DANDI for your neurophysiology data needs.

Sincerely,

The DANDI team
The EMBER team
{% endautoescape %}
2 changes: 1 addition & 1 deletion dandiapi/api/templates/api/mail/new_user_message.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% autoescape off %}
A new user ({{ username }}) has signed up for DANDI.
A new user ({{ username }}) has signed up for EMBER-DANDI.

Please proceed to the following URL to approve or reject their account:

Expand Down
16 changes: 7 additions & 9 deletions dandiapi/api/templates/api/mail/registered_message.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
{% autoescape off %}
Dear {{ greeting_name }},

Welcome to DANDI.
Welcome to EMBER-DANDI.


Thank you for registering on the DANDI Archive. Your account is now pending approval by
a DANDI admin. Once approved, you will be able to create Dandisets and upload data right
away. You will also be able to use the Jupyterhub (https://hub.dandiarchive.org) for
computing on dandisets in the cloud.
Thank you for registering on the EMBER-DANDI archive. Your account is now pending approval by
an EMBER-DANDI admin. Once approved, you will be able to create Dandisets and upload data right
away.

It may take up to 48 hours for your account to be approved and for your email to be
registered with our Slack workspace.
It may take up to 48 hours for your account to be approved.

Please use the following links to post any questions or issues.

Expand All @@ -20,9 +18,9 @@ Issues: https://github.com/dandi/helpdesk/issues/new/choose
YouTube: https://www.youtube.com/@dandiarchive
(please Subscribe)

Thank you for choosing DANDI for your neurophysiology data needs.
Thank you for choosing EMBER-DANDI for your neurophysiology data needs.

Sincerely,

The DANDI team
The EMBER team
{% endautoescape %}
10 changes: 5 additions & 5 deletions dandiapi/api/templates/api/mail/rejected_user_message.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{% autoescape off %}
Dear {{ greeting_name }},

Your DANDI account has been denied approval.
Your EMBER-DANDI account has been denied approval.
{% if rejection_reason %}
Detailed reason:
{{ rejection_reason }}
{% endif %}

DANDI is freely accessible to the neuroscience research community. Membership is usually granted automatically to GitHub accounts with a .edu or similar academic email. If your registration is denied:
EMBER-DANDI is freely accessible to the neuroscience research community. Membership is usually granted automatically to GitHub accounts with a .edu or similar academic email. If your registration is denied:

- With an academic email not linked to your GitHub, please contact [email protected] for assistance using this academic email address to verify your academic affiliation.
- With an academic email not linked to your GitHub, please contact [email protected] for assistance using this academic email address to verify your academic affiliation.

- Without an academic email, account approval is still possible under specific circumstances. You can appeal the decision by contacting [email protected].
- Without an academic email, account approval is still possible under specific circumstances. You can appeal the decision by contacting [email protected].

For more information, see the "Create a DANDI Account page" at https://docs.dandiarchive.org/16_account.

Sincerely,

The DANDI team
The EMBER team
{% endautoescape %}
6 changes: 3 additions & 3 deletions dandiapi/api/templates/api/root_content.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% block body %}
<h5>Welcome! Are you lost?</h5>

<p>This is the Django service that supports the DANDI API. There's
<p>This is the Django service that supports the EMBER-DANDI API. There's
nothing specifically valuable at this exact location. You are probably
looking for one of the following instead:</p>

Expand All @@ -14,13 +14,13 @@ <h5>Welcome! Are you lost?</h5>
<li><a href="{% url 'schema-redoc' %}">Redoc</a> documentation for
the same</lit>

<li>The <a href="{{ web_app_url }}">DANDI Archive</a>
<li>The <a href="{{ web_app_url }}">EMBER-DANDI Archive</a>
instance associated with this API server</li>

<li>The <a href="https://about.dandiarchive.org">DANDI project</a>
website</li>
</ul>

<p>If none of these is helpful, you can contact the DANDI team by <a
href="mailto:[email protected]">email</a>. Have a great day!</p>
href="mailto:[email protected]">email</a>. Have a great day!</p>
{% endblock body %}
4 changes: 2 additions & 2 deletions web/src/components/UserStatusBanner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ export default defineComponent({
switch (user.value?.status) {
case 'PENDING':
return {
text: 'Your DANDI account is currently pending approval. Please allow up to 2 business days for approval and contact the DANDI admins at [email protected] if you have any questions.',
text: 'Your DANDI account is currently pending approval. Please allow up to 2 business days for approval and contact the DANDI admins at [email protected] if you have any questions.',
icon: 'mdi-timer-sand-empty',
color: 'warning',
};
case 'REJECTED':
return {
text: 'Your DANDI account was denied approval. Please contact the DANDI admin team at [email protected] if you would like to appeal this decision.',
text: 'Your DANDI account was denied approval. Please contact the DANDI admin team at [email protected] if you would like to appeal this decision.',
icon: 'mdi-close-octagon',
color: 'error',
};
Expand Down
2 changes: 1 addition & 1 deletion web/src/views/DandisetLandingView/DandisetLandingView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</span>
<br><br>
<span class="text-body-2">
For further assistance, please contact <a href="mailto:[email protected]">[email protected]</a>.
For further assistance, please contact <a href="mailto:[email protected]">[email protected]</a>.
</span>
</div>
</v-container>
Expand Down

0 comments on commit 3dbb29a

Please sign in to comment.