This module stores alternative email addresses for users, in addition to the single primary email address stored in the user's mail field.
This can be useful for preventing duplicate users being created for people who have multiple email addresses, as most of us do.
What it does
- A multi-value field called 'alternative_user_emails' is added to the user entity type.
- When the primary email is changed, the old email is automatically added to the alternatives.
- User entity queries are altered so that queries that filter by the mail field also filter by the alternatives.
- Validation ensures that mails and alternatives are unique to a user.
How to use
Dev branch and beta releases
Drupal 10.3 and 11 include the fix to make this module work properly, so no core patching is required. Simply install the module with composer. You must be using Drupal 10.3 or 11 to use the dev branch or beta releases.
Alpha releases
You will need to install this core patch in order for the entity queries to be altered and
validation to work properly: #3001496: Add an alter hook to EntityQuery
No configuration is needed or available.
Recommended modules
- Read-only widget is useful if you wish to show the alternative emails on a user form, but not allow them to be edited.
Related modules
- Multiple E-mail Addresses is a much more ambitious and feature-rich approach to allowing multiple email addresses for users. It is now available for Drupal 8+. However, it does not modify user queries in the way this module does.
Contributing
All contributions are welcome. Please submit MRs, not patches, so that the CI tests are run. Please add tests if possible.
If you post an issue and do not receive a response, feel free to contact me by private message in the Drupal Slack (ptmkenny) or via my Drupal.org contact form.
Sponsors
Initial development: Awakened Heart Sangha
Project information
Maintenance fixes only
Considered feature-complete by its maintainers.- Project categories: Access control
33 sites report using this module
- Created by jonathanshaw on , updated
Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.
