AnnouncerPlugin is pretty easy to extend.  For example, you could
create a subclass of TicketReporterSubscriber:

from announcer.subscribers import TicketReporterSubscriber

class StatusLimitedTicketReporterSubscriber(TicketReporterSubscriber):
    statuses = [ ... ] # Statuses for which no notification is sent
                       # A better approach would be to get this from trac.ini

    def matches(self, event):
        if event.realm != 'ticket':
            return
        ticket = event.target
        if ticket['status'] not in self.statuses:
            return

        return super(StatusLimitedTicketReporterSubscriber, self).matches(event)

Put this in a module, drop it into your plugins directory, then
disable the normal TicketReporterSubscriber in your trac.ini
[components] section and enable this one instead.


On Tue, Mar 1, 2011 at 5:08 PM, ElJefeWatson <[email protected]> wrote:
> Yes, there is another hack called FlexibleReporterNotification that
> will do that, but it uses the TracNotification.  I like the look
> (mostly) of the HTML formatted tickets that come out of announcer.
>
> On Mar 1, 4:19 pm, Chris Shelton <[email protected]> wrote:
>> On Tue, Mar 1, 2011 at 10:23 AM, ElJefeWatson <[email protected]>wrote:
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> > We have a large pile of external users who contact our help desk who
>> > then enters the ticket in trac for them or resolves it (password
>> > change, desktop config problems, etc), so they are not users that go
>> > into trac and configure their preferences.  They help desk will enter
>> > their email address as the reporter.  We want to email the reporter if
>> > their problem is logged as a trac ticket for a software change.  When
>> > it gets approved for work we want another email to the reporter, and
>> > when it gets closed we want another email sent to them.  All the
>> > statuses in between we don't want to mail bomb the reporter.
>>
>> > In the Announcer plugin is there way to send emails to the reporter
>> > based on the status?  I've hacked some new code to do that, but was
>> > wondering whether it was possible without that and I missed
>> > something.
>>
>>  I've looked for a similar type of functionality with the AnnouncerPlugin,
>> and could not find it either.  I ended up using a ticket_custom field named
>> "nomail" that is a checkbox labelled "Suppress Mail".  Then I added the
>> attached diff to the 0.11 version of the announcerplugin.
>>
>> I seem to remember locating a version of this patch in a ticket on trac
>> hacks, and adapted it for my occasional needs to limit the amount of mail
>> going out.  It would certainly be nicer to have this based on a set of
>> statuses where notifications would be suppressed.
>>
>> chris
>>
>>  announcerplugin_suppress_mail.diff
>> 2KViewDownload
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Trac Users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/trac-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en.

Reply via email to