Skip to content

Commit

Permalink
Merge pull request #34542 from dimagi/jc/remove-ops-email-from-sso-alert
Browse files Browse the repository at this point in the history
Remove ops email from sso alert
  • Loading branch information
jingcheng16 committed May 14, 2024
2 parents 064eb19 + 92056bb commit 1e4cea8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,13 @@
{% endblocktrans %}
</p>

<p>
{% blocktrans %}
To change or renew your subscription, please reach out to {{ sales_email }}.
{% endblocktrans %}
</p>

<p>
{% blocktrans %}
If you have any questions, please don’t hesitate to contact
{{ contact_email }}. Thank you for your use and support of CommCare.
{% endblocktrans %}
</p>


<p>
{% blocktrans %}
Best regards,
Expand Down
31 changes: 3 additions & 28 deletions corehq/apps/sso/utils/context_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,31 +66,6 @@ def get_idp_cert_expiration_email_context(idp):
return email_context


def get_graph_api_connection_issue_email_context(idp, error):
subject = _("CommCare HQ Alert: SSO Remote User Management - Issue Connecting to Microsoft Graph API")
template_context = {
"error": error,
"contact_email": settings.ACCOUNTS_EMAIL,
"base_url": get_site_domain(),
}
body_html, body_txt = render_multiple_to_strings(
template_context,
"sso/email/microsoft_graph_api_connection_issue_notification.html",
"sso/email/microsoft_graph_api_connection_issue_notification.txt",
)
email_context = {
"subject": subject,
"from": _(f"Dimagi CommCare Accounts <{settings.ACCOUNTS_EMAIL}>"),
"to": idp.owner.enterprise_admin_emails or [idp.owner.dimagi_contact] or [settings.ACCOUNT_EMAIL],
"bcc": [settings.ACCOUNTS_EMAIL],
"html": body_html,
"plaintext": body_txt,
}
if idp.owner.dimagi_contact:
email_context["bcc"].append(idp.owner.dimagi_contact)
return email_context


def get_sso_deactivation_skip_email_context(idp, failure_reason):
subject = _("CommCare HQ Alert: Temporarily skipped automatic deactivation of SSO Web Users"
" (Remote User Management)")
Expand All @@ -107,8 +82,8 @@ def get_sso_deactivation_skip_email_context(idp, failure_reason):
email_context = {
"subject": subject,
"from": _(f"Dimagi CommCare Accounts <{settings.ACCOUNTS_EMAIL}>"),
"to": idp.owner.enterprise_admin_emails or [idp.owner.dimagi_contact] or [settings.ACCOUNT_EMAIL],
"bcc": [settings.ACCOUNTS_EMAIL],
"to": idp.owner.enterprise_admin_emails or [idp.owner.dimagi_contact] or [settings.ACCOUNTS_EMAIL],
"bcc": [],
"html": body_html,
"plaintext": body_txt,
}
Expand Down Expand Up @@ -155,7 +130,7 @@ def get_api_secret_expiration_email_context(idp):
"subject": subject,
"from": _(f"Dimagi CommCare Accounts <{settings.ACCOUNTS_EMAIL}>"),
"to": idp.owner.enterprise_admin_emails,
"bcc": [settings.ACCOUNTS_EMAIL],
"bcc": [],
"html": body_html,
"plaintext": body_txt,
}
Expand Down

0 comments on commit 1e4cea8

Please sign in to comment.