The code in Message Subscribe Email removes everyone from the email subscription list that doesn't have a subscription in the database. That means if you use hook_message_subscribe_get_subscribers() or hook_message_subscribe_get_subscribers_alter() to add users to the subscription list, it is impossible to send them mail.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

KarenS created an issue. See original summary.

KarenS’s picture

Status: Active » Needs review
FileSize
1.56 KB

With this patch, you can send email to additional users, by passing the email flags in the hook:

function hook_message_subscribe_get_subscribers_alter(array &$uids, array $values) {
  $uid = 26;
  if (!array_key_exists($uid, $uids)) {
    $uids[$uid] = new DeliveryCandidate(['subscribe_node', 'subscribe_user', 'email_node', 'email_user'], ['email'], $uid);
  }
}
KarenS’s picture

  • jhedstrom committed 3c43966 on 8.x-1.x authored by KarenS
    Issue #3101141 by KarenS: Message Subscribe Email removes all emails
    
jhedstrom’s picture

Status: Needs review » Fixed

This looks good. Thanks!

Status: Fixed » Closed (fixed)

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