Alternative User Emails
This module allows users to store multiple email addresses in addition to their primary one, helping to prevent duplicate user accounts. It automatically adds old primary emails to the alternative list when the primary is changed and ensures all email addresses are unique to a user. It also modifies user queries to include alternative emails when searching by the primary email field.
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.
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