Using Support 6.x-1.2 and Support Nag 6.x-1.x-dev.

In the Support Nag settings, under, "Only apply action to selected state(s):" I have the following selected:
new, action, reviewed, pending

Under, "Only apply action to selected priorities:" I have the following selected:
critical

I should receive Nag email notifications of any critical ticket with a state of new, action, reviewed or pending. I should NOT receive Nag emails if a critical ticket has a state of closed. (In other words, if a ticket is closed I should not receive Nag emails about it.) However, I am receiving Nag emails of critical tickets which have been closed.

Comments

NToronto’s picture

friendly bump :-)

downtap’s picture

I'm finding that nag emails are sent on everything. Receiving blank emails like this:

This is a regular notification for the following open tickets:

[tickets]

I know it's alpha, but I'm trying to avoid hacking it to death if there's some known easy fixes.

NToronto’s picture

I am experiencing the same issue as downtap.

cbutera’s picture

Same problem here. Trying to get a daily digest of tickets with new status. But all I get is a blank email with [tickets] (there are no new tickets).

NToronto’s picture

Friendly bump? Any resolution?

jeremy’s picture

Priority: Normal » Critical

Marking as a critical bug as currently the module does not work like designed, and clearly this is a blocker before a new version of the module could be released.

Patches are encouraged...

schildi’s picture

token replacement depends on language setting. Possibly it finds not the right language to use.
As far as I know the page language is taken as default.
I don't have this issue but modified the source code a bit. In file support_nag.module (near end of function support_nag_cron) there is now

      foreach ($uids as $uid) {
        $user = user_load($uid);            // extract mail address from user
        $mailto = $user->mail;
        $lang = $user->language;
        $mail = drupal_mail('support_nag', 'notify', $mailto, $lang, $params, $mailfrom);
      }

Does this help anybody?

St.Ego’s picture

The problem is that the support_nag_cron() does not stop execution when no tickets are found. I fixed the problem by adding a check on the total $nids found, and to skip mailing if none, starting around line 65 of support_nag.module:


      while ($notify = db_fetch_object($result2)) {
        $nids[] = $notify->nid;
      }
if(count($nids)) {
      $params = array();
      $params['subject'] = token_replace($nag->subject, 'support-notify', $nids);
      $params['body'] = token_replace($nag->message,'support-notify', $nids);
      $mailfrom = variable_get('support_global_mailfrom', '');
      $uids = explode(',', $nag->mailto);
      foreach ($uids as $uid) {
        $mailto = db_result(db_query('SELECT mail FROM {users} WHERE uid = %d', $uid));
        $mail = drupal_mail('support_nag', 'notify', "cdavidkraeft@miragelab.com", NULL, $params, $mailfrom);
        $mail = drupal_mail('support_nag', 'notify', $mailto, NULL, $params, $mailfrom);
      }
}