[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Different mail-format or on-change action for particular Category
From: |
Mel Hatzis |
Subject: |
Re: Different mail-format or on-change action for particular Category |
Date: |
Tue, 24 May 2005 16:51:07 -0700 |
User-agent: |
Mozilla Thunderbird 1.0.2 (Macintosh/20050317) |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Tim Buck wrote:
> Is there any way to have GNATS use a different mail-format or apply
> a different on-change action depending on the category of the PR,
> or depending on whether or not a PR is marked confidential?
Not currently, however I've developed exactly this functionality
for my employer and it's proved to be extremely useful. I was planning
on incorporating this to the official GNATS project over the next month
or two.
The way it works is that each mail-format definition has a
mandatory 'trigger' associated with it (e.g. "on-create",
"on-append", etc). Furthermore, each trigger can be specified with
an optional condition constraining when the trigger is "fired".
So, a mail-format definition in dbconfig looks like:
#
# This format is used for initial PRs that end up as pending PRs.
#
mail-format "initial-pr-notification-pending" {
trigger on-create "Category==\"pending\""
from-address {
"From:" | "From"
}
to-addresses {
fixed-address "gnats-admin" "Reply-To:" | "From:"
"Notify-List"
}
...etc
}
The GNATS code is modified so that rather than sending email
notifications of hardwired mail-format names, it sends email
based on the triggers. You can have multiple mail-formats
defined to trigger "on-create" for example (nominally with
different trigger conditions) and the relevant notifications
will be sent out based on which trigger conditions are applicable
to the state of the PR.
The mail-format names are essentially unused...they have been
retained for potential logging/error reporting.
- --
Mel Hatzis
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (Darwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFCk73qNF74HmYqaSERAstTAJ0bVv/9CDUHbk3KQ9wcNysXkqwYiQCgmQQZ
EwcMk5KY29IOSVAt4n8NyPs=
=qQM7
-----END PGP SIGNATURE-----