Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The views_send module ignores when $message['send'] === FALSE. This is used by various modules to suppress email. This patch adds support for that, so people can be excluded from receiving email.
Added by hansfn:
The value of $message['send'] can be modified in hook_mail_alter - ref API documentation for drupal_mail.
Comment | File | Size | Author |
---|---|---|---|
views_send-unsubscribe.patch | 560 bytes | karan.kumar |
Comments
Comment #1
hansfn CreditAttribution: hansfn commentedOK, I'll add support for the Unsubscribe module. The patch can't be used as it it (for various reasons), but I have time to rework it. Expect a quick fix ;-)
PS! I have reclassified it as a bug since the drupal_mail documentation clearly states: "Modules implementing hook_mail_alter() may cancel sending by setting $message['send'] to FALSE." Views Send has ignored this.
Comment #2
hansfn CreditAttribution: hansfn commentedJust a quick comment: The patch is really no good - it just stops all email from being sent, no matter if the Unsubscribe module is used or not, because $message['send'] is never set. $message isn't a complete copy of the return value from drupal_mail.
Back to work on the issue.
Comment #3
hansfn CreditAttribution: hansfn commentedTrying to set a better title - 2nd try.
Comment #5
hansfn CreditAttribution: hansfn commentedFixed in commit a9bdccd.
PS! To make it work with the Unsubscribe module, you also need to apply the patch in #2215957: Try to load account object if not present.