Email template admin_login

AI-generated summary

The discussion revolves around the email template user_notifications.admin_login.text_body_template. TempAccount discovered this template while editing site text and wondered when it is triggered. tobiaseigen initially suggested editing email templates via the site’s email settings, but later clarified that the email is sent when using the ‘Skip the password; email me a login link’ method. JammyDodger pointed out that this specific template is triggered from logging in on the /u/admin-login page. The purpose of this login method, often referred to as an ‘admin backdoor’, is to provide an alternative login option when the regular login is blocked due to misconfiguration, such as SSO issues, as explained by JammyDodger.

When editing the site text, I discovered: user_notifications.admin_login.text_body_template

When is this triggered at all? The default body template is:

Somebody asked to log in to your account on %{site_name}.

If you did not make this request, you can safely ignore this email.

Click the following link to log in:
%{base_url}/session/email-login/%{email_token}

You can edit email templates via your site’s email settings. Here’s the direct link:

https://yoursite/admin/email/templates/user_notifications.admin_login

That is how i discovered it.

My question is how is the email generated in the first place?

Oh I see what you mean. Sorry I misunderstood.

That email is sent when you log in using the "Skip the password; email me a login link: method.

I think that specific one (user_notifications.admin_login.text_body_template) is triggered from logging in on the /u/admin-login page. :+1:

You are right! I tested the regular email login but didn’t notice it says “Here’s your link to log in at..” instead of “Somebody asked..” Otherwise it’s almost the same.

When would an admin use this as opposed to the regular log in button?

A better question might be, the option to log in this way exists for a reason, what?

The /u/admin-login is often referred to as an admin ‘backdoor’. It’s one of the tools that can be used when a misconfiguration has blocked normal login. I think I’ve seen it most used for SSO snafus.

The checkbox to enable safe mode at the same time is also quite handy. :slight_smile: