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.
Hi,
Here is my setup:
- User A subscribed to node 1 (get email when a comment is posted on node 1)
- User A also subscribed to user B (get email when user B does some action, in this case commenting on a node)
- When user B posts a comment on node 1, user A gets the same email twice, one from node 1 subscription, one from user B subscription.
This is because in my hook_comment_insert(), I send emails out to both node's subscribers and the acting user's subscribers
function hook_comment_insert($comment) {
...
message_subscribe_send_message('user', $account, $message); // notify acting user's subscribers
message_subscribe_send_message('node', $node, $message); // notify node's subscribers
}
Is there any way to fix or work around this? Or is this not a correct way to achieve what I want?
Thanks,
Long
Comments
Comment #1
longmtran CreditAttribution: longmtran commentedComment #2
longmtran CreditAttribution: longmtran commentedComment #3
longmtran CreditAttribution: longmtran commentedComment #4
bluegeek9 CreditAttribution: bluegeek9 as a volunteer commented