diff --git a/backend/app/services/email_templates.py b/backend/app/services/email_templates.py index f05896f..7dc9f63 100644 --- a/backend/app/services/email_templates.py +++ b/backend/app/services/email_templates.py @@ -38,8 +38,13 @@ def build_employee_invitation_email( ) ) - subject = ( - f"Account invitation: {manager} added you to {organization} on {BRAND_NAME}" + subject = f"{manager} invited you to join {organization}" + + why_received = ( + f"You are receiving this because {manager} invited you to a work email " + f"account at {organization} on {BRAND_NAME}. It was sent to the personal " + f"email address your administrator provided so you can complete your " + f"first sign-in." ) unexpected_contact = ( @@ -51,11 +56,7 @@ def build_employee_invitation_email( body_text = ( f"Hello {first_name},\n\n" - f"{manager} has created a work email account for you on {BRAND_NAME}, " - f"the email platform used by {organization}.\n\n" - f"This automated notification was sent to the personal email address " - f"your administrator provided. It contains the sign-in details for " - f"your new organization account.\n\n" + f"{why_received}\n\n" f"Organization: {organization}\n" f"Work email address: {member_email}\n" f"Sign-in page: {login_url}\n\n" @@ -67,12 +68,13 @@ def build_employee_invitation_email( f"—\n" f"{BRAND_NAME}\n" f"{login_url.rsplit('/login', 1)[0] or login_url}\n" - f"This is an account notification sent on behalf of {organization}." + f"This is a one-time account notification from {BRAND_NAME} on behalf of " + f"{organization}. You cannot unsubscribe from required account emails." ) preheader = ( - f"{manager} added you to {organization}. " - f"Your work email account is ready — review your sign-in details." + f"{manager} invited you to join {organization}. " + f"Use the sign-in details below to access your work inbox." ) safe_first = _escape(first_name) @@ -85,6 +87,7 @@ def build_employee_invitation_email( safe_preheader = _escape(preheader) safe_security = _escape(security_note) safe_unexpected = _escape(unexpected_contact) + safe_why_received = _escape(why_received) body_html = f""" @@ -130,9 +133,9 @@ def build_employee_invitation_email(

Organization invitation

+ text-transform:uppercase;color:#ff6a52;">Work email invitation

- You have been added to
+ {safe_manager} invited you to join
{safe_org}

@@ -142,15 +145,8 @@ def build_employee_invitation_email(

Hello {safe_first},

-

- {safe_manager} has created a work email - account for you on {BRAND_NAME}, - the email platform used by {safe_org} - for business communication. -

- This message was sent to the personal email address your administrator - provided. Use the details below to access your new organization inbox. + {safe_why_received}

@@ -201,8 +197,8 @@ def build_employee_invitation_email( {BRAND_NAME} · {BRAND_HANDLE}

- This is an automated account notification sent on behalf of {safe_org}. - {" Reply to " + safe_manager_email + " if you need help." if manager_address else ""} + One-time account notification from {BRAND_NAME} on behalf of {safe_org}. + {" Questions? Reply to " + safe_manager_email + "." if manager_address else ""}

diff --git a/backend/tests/test_email_templates.py b/backend/tests/test_email_templates.py index 96cd494..ece3b16 100644 --- a/backend/tests/test_email_templates.py +++ b/backend/tests/test_email_templates.py @@ -13,20 +13,18 @@ def test_employee_invitation_uses_gentic_branding(): force_password_change=True, ) - assert "aGentic Email" in subject - assert subject == ( - "Account invitation: Suyash Dixit added you to road.rentals on aGentic Email" - ) + assert subject == "Suyash Dixit invited you to join road.rentals" assert "AGMail" not in subject - assert "Suyash Dixit" in subject - assert "road.rentals" in subject + assert "aGentic Email" not in subject - assert "Gentic Email" in body_text + assert "aGentic Email" in body_text assert "AGMail" not in body_text - assert "Suyash Dixit has created a work email account" in body_text + assert "You are receiving this because Suyash Dixit invited you" in body_text + assert "cannot unsubscribe from required account emails" in body_text assert "anurag@road.rentals" in body_text assert "gentic.email" in body_html - assert "Organization invitation" in body_html + assert "Work email invitation" in body_html + assert "invited you to join" in body_html assert "Sign in to aGentic Email" in body_html assert "AGMail" not in body_html