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.
Comment | File | Size | Author |
---|---|---|---|
#7 | Issue-1827980-by-hass-Module-requirements-and-email-.patch | 3.88 KB | hass |
Comments
Comment #0.0
hass CreditAttribution: hass commenteda
Comment #0.1
hass CreditAttribution: hass commenteda
Comment #1
hass CreditAttribution: hass commented#1477934: Username instead of real name in [user:one-time-login-url] was the same problem.
Comment #2
Dave ReidHrm, 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.
Comment #3
hass CreditAttribution: hass commentedChanging 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.Comment #4
hass CreditAttribution: hass commented#1879800: Account creation email alert to user has the wrong username! is a duplicate
Comment #5
hass CreditAttribution: hass commentedChanging to code for hook_requirements()
Comment #6
hass CreditAttribution: hass commentedCore case is #734878: [user:name] tokens should be using format_username() and use [user:name-raw] in email templates
Comment #6.0
hass CreditAttribution: hass commenteda
Comment #7
hass CreditAttribution: hass commentedCreated a patch for this. RTBC.
Comment #8
hass CreditAttribution: hass commentedComment #9
hass CreditAttribution: hass commentedhttp://drupalcode.org/project/realname.git/commit/f1f729b