My installation provide managing of documents status via the Workflow module, moderators do their job via Workflow, so they can't uncheck the send Subscriptions' notifications checkbox in publishing options (also because they don't have "administer nodes" privilege anyway).
I want only send notifications via Subscriptions to users when a node is published: promoting, demoting, sticking, unsticking are irrelevant.
Here the question: in "subscriptions_queue" function i've seen at 283-289:

  foreach (module_implements('subscriptions_queue_alter') as $module) {
    $function = $module .'_subscriptions_queue_alter';
    $function($event);
    if (empty($event)) {
      return;  // $event was cleared, forget it
    }
  }

So, if I don't misunderstood, it's possible to write a module that implements hook_subscriptions_queue_alter where, made the necessary considerations ($event[is_new]==FALSE), I can clear $event array so enqueuing does'nt happen.
It is correct?

Comments

salvis’s picture

Exactly.

The challenge is to detect whether a change is minor or major. If you can solve that, then setting $event to NULL in MYMODULE_subscriptions_queue_alter(&$event) will suppress enqueueing.

mas160’s picture

Status: Active » Closed (fixed)

The challenge is to detect whether a change is minor or major.

In my case this is simple: only new contents are relevant (for subscriptions), and editing of published contents isn't admitted, so editing of a published node implies it is unpublished before, and after editing it will be republished, triggering the notification again.
I see is a very particular case, anyway big thanks.