Duplicate notification for node's subscriber and acting user 's subscriber when a comment is posted in the node

Created on 1 July 2015, almost 9 years ago
Updated 6 January 2024, 6 months ago

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

πŸ’¬ Support request
Status

Closed: outdated

Component

Miscellaneous

Created by

πŸ‡¬πŸ‡§United Kingdom longmtran

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024