SaaS email template

Security alert email — immediate, clear and trustworthy

Fire security.new_login with device info and a secure-account link. else.events sends a consistent, branded security alert that users recognise and trust.

Common mistakes with security alert emails

Inconsistent branding makes it look like phishing

A security alert that looks different from other product emails is the first thing users distrust.

No device or location information

"A new login was detected" with no context is useless. Users need device type, approximate location and time to judge whether it was them.

No secure-account action link

"Was this not you?" with no link to immediately secure the account is a liability. Users need a one-click path to revoke access.

Hardcoded in the auth service

Security alert email logic buried in the auth service means every copy update requires a deployment.

Device info, location, time and secure-account link — all from the payload

Device and location data from the payload

Include device type, approximate location and login time in the event payload. The template renders "Login from Chrome on Mac, Frankfurt, Germany at 14:03."

Secure-account link from the payload

Generate a secure-account or revoke-access URL in your backend. Include it in the payload. The template renders "Was this not you? Secure your account now."

Consistent branding with all other product emails

Security alerts use the same MJML template base and brand variables. No phishing-like visual inconsistency.

Managed outside your auth service

Update security alert copy, add a locale or change the CTA text without touching the auth service.

Template variables for the security alert email

  • {{ user.name }}Recipient name
  • {{ user.email }}Account email address
  • {{ data.event_type }}Security event type — new_login, password_changed, api_key_created
  • {{ data.device }}Device type and browser (e.g. Chrome on Mac)
  • {{ data.location }}Approximate location (e.g. Frankfurt, Germany)
  • {{ data.timestamp }}Time of the security event
  • {{ data.secure_account_url }}Link to revoke access or secure the account

Frequently asked questions

What subject lines work for security alert emails?
"New login to your [App] account from Chrome on Mac", "Security alert: new login detected", "Was this you? New login to [App]". Include device or location for immediate context.
How do I get the user's location for the alert?
Extract the IP address from the login request in your backend. Use a geolocation service to resolve it to a city and country. Include the result in the event payload as data.location. else.events does not perform geolocation.
What if the security alert itself looks like phishing?
Use the same template base, sender name, logo and branding as your other product emails. Include your app name in the subject and body. Avoid urgent language that sounds like a scam warning.
Should security alerts have unsubscribe links?
No. Security alerts are transactional and trust-critical. Including an unsubscribe link on a security alert is both a UX mistake and a compliance concern in most jurisdictions.

Security alerts that users recognise and act on

Device info, location, timestamp and a secure-account link — all from the event payload.

  • Device and location from payload
  • Secure-account link rendered directly
  • Consistent branding — no phishing confusion