Often we have multiple contacts with a shared email address, as when a parent provides their own email when they register one or more children. We use the option in civimail to only send one email to each unique address to avoid duplicates. If they unsubscribe, only one of the family contacts is actually unsubscribed, so the other contacts with the same address continue to receive email. To the parent it looks like we are ignoring their unsubscribe request. Is there a way to have an unsubscribe request apply to all contacts with the same email address?
1 Answer
Short answer: no.
An unsubscribe request is handled here:
https://github.com/civicrm/civicrm-core/blob/master/CRM/Mailing/Form/Unsubscribe.php
The parameters to an unsubscribe request are translated into the corresponding contact, not the email address.
So what you're asking would require the code to scan the database for contacts with the same email address to unsubscribe, which in some circumstances wouldn't be the desired result.
Conceptually, unsubscribes/subscribes are stored/handled by contact id, not email address.
Your options would be to write your own unsubscribe handler, or (perhaps) to use civirules.