ANN: WorkflowNotificationPlugin

45 views
Skip to first unread message

Ethan Jucovy

unread,
Dec 11, 2012, 9:14:13 PM12/11/12
to trac-...@googlegroups.com
Hi,

I've released a new (BSD licensed) plugin on Trac Hacks, PyPI and Github.  WorkflowNotificationPlugin enables configurable email notifications tied to ticket workflow events.  For example, you could set up one email notification to be sent out when the "resolve" action is taken, and a different email notification to be sent out when the "accept" or "reassign" actions are taken.

The plugin does not make any assumptions about your workflow configuration, or even whether you're using the built-in ITicketActionController at all.

Notifications are configured through trac.ini using a syntax that's similar to Trac's built-in configurable workflow.  Each notification's subject, body, and recipient list is defined as a Genshi template, whose template context includes the ticket's new values, old values, and the change comment and author.  So notifications can be quite flexible; you could send out a notification to the ticket's reporter and CC list, or to a hard coded list of email addresses and usernames, or to the value of some custom field, etc.  You can also use this plugin to generate something like Trac's built in ticket notification email, by comparing the ticket's old values and new values in the "body" template.

You can also configure conditional notifications.  For example, you can set up a notification that will be sent out when the "resolve" action occurs, but only if the ticket's new resolution is "fixed".

More usage details and examples are available here:


The plugin's source code is on Github:


I've uploaded a release to PyPI here:


The plugin was developed against Trac trunk, but as far as I know it should be compatible with Trac 0.11 and up.  Python 2.6 and up are supported; support for Python 2.4 would be easy enough if there's any need for it, though.

Best,
Ethan

Geert

unread,
Jan 22, 2013, 2:25:53 PM1/22/13
to trac-...@googlegroups.com
Hi Ethan,

I deployed your plugin on Trac 1.0 & python 2.7. It worked without a problem, thanks.

One question though, how do I add blank lines to the body of my notification emails? If I just add a blank line then they don't show up in the email.


Cheers - Geert

Ethan Jucovy

unread,
Jan 30, 2013, 8:46:18 AM1/30/13
to glin...@dynamiccontrols.com, trac-...@googlegroups.com
Hi Geert,

On Tue, Jan 22, 2013 at 2:25 PM, Geert <glin...@dynamiccontrols.com> wrote:
Hi Ethan,

I deployed your plugin on Trac 1.0 & python 2.7. It worked without a problem, thanks.

One question though, how do I add blank lines to the body of my notification emails? If I just add a blank line then they don't show up in the email.

You can add blank lines by typing "\n" in your email template.  The plugin's code will parse these "\n" strings into actual newline characters.  So, for example, a configuration like

    notice.body = Notification for ticket $ticket.id: $link\n\n\n\nThis is a notification.

should result in an email body with four blank lines between the two sentences.

This seems to work more reliably than using the .ini file's own multi-line syntax which apparently collapses whitespace.

I've added this information into the plugin's wiki documentation.

Let me know if this doesn't work for you.

-Ethan

Geert

unread,
Feb 3, 2013, 3:21:39 PM2/3/13
to trac-...@googlegroups.com, glin...@dynamiccontrols.com
Hi Ethan,

Thanks, that works  :-)


Cheers - Geert
Reply all
Reply to author
Forward
0 new messages