After 6 weeks of continued first time login usability issues we learned that we missed to change the username tokens in E-mails settings admin/config/people/accounts from [user:name] to [user:name-raw].

E-Mails that must be changed after installation:

  • Welcome (new user created by administrator)
  • Welcome (no approval required)
  • Account activation

This must at least be noted in the readme as first steps after enabling the module. Otherwise users will try to login with their realname (login failures) and not their username.

It may also be a good idea to search in these email variables via a hook_requirement or on the Realname settings page for [user:name-raw] and if this token is not found in the 2-3 well known emails where these are required - fire a warning/error on admin pages.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hass’s picture

Issue summary: View changes

a

hass’s picture

Issue summary: View changes

a

hass’s picture

Dave Reid’s picture

Hrm, good catch. We should probably alter those defaults on Realname enable or make a hook_requirements to check for those tokens in the mails. Or we could use hook_mail_alter() and modify them on demand. I'm not quite sure what is a fool-proof path forward. It's a shame that core doesn't have a token for name-raw because it shouldn't be using a token that calls format_name() since it could return a different value than the login name. I'm going to file a core issue for this in the meantime.

hass’s picture

Changing core is a very good idea. For going forward here we should only warn. Otherwise we may destroy something. If we cannot find the raw token we push an warning or error. If we alter the mail we may destroy a Hello [name] ... Your login name is [name-raw].... Better safe than sorry.

hass’s picture

hass’s picture

Component: Documentation » Code

Changing to code for hook_requirements()

hass’s picture

hass’s picture

Issue summary: View changes

a

hass’s picture

Issue summary: View changes
Status: Active » Needs review
FileSize
3.88 KB

Created a patch for this. RTBC.

hass’s picture

hass’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.