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.

CommentFileSizeAuthor
views_send-unsubscribe.patch560 byteskaran.kumar
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hansfn’s picture

Assigned: Unassigned » hansfn
Category: Feature request » Bug report
Status: Needs review » Needs work

OK, 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.

hansfn’s picture

Just 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.

hansfn’s picture

Title: Add support for the unsubscribe module » Respect $message['send'] when sending mail
Issue summary: View changes

Trying to set a better title - 2nd try.

  • hansfn committed a9bdccd on 7.x-1.x
    Issue #2339739 by hansfn: Respect $message['send'] when sending mail....
hansfn’s picture

Status: Needs work » Fixed

Fixed 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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.