Changes between Version 17 and Version 18 of WorkflowNotificationPlugin
- Timestamp:
- Sep 9, 2015, 4:35:12 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WorkflowNotificationPlugin
v17 v18 5 5 == Description 6 6 7 WorkflowNotificationPlugin enables flexible configuration of email notifications tied to ticket workflow changes.7 This plugin enables flexible configuration of email notifications tied to ticket workflow changes. 8 8 9 9 Administrators can configure any number of distinct email notifications to be sent out when a workflow operation occurs on a ticket. Each email notification is specifically attached to one or more workflow operations, so (for example) separate emails can be sent out when a ticket is accepted, reassigned, resolved, reopened, or marked "in QA". … … 12 12 to the ticket's data, the comment (if any) that was left on the ticket, and the author of the change. Therefore notifications can be very flexible: some notifications can be sent to the ticket's reporter, others to its owner or CC list, others to the current updater, and others to hard-coded lists of users. 13 13 14 The notification emails sent by this plugin respect Trac's ALWAYS_CC and ALWAYS_BCCsettings.14 The notification emails sent by this plugin respect Trac's `ALWAYS_CC` and `ALWAYS_BCC` settings. 15 15 16 16 The notification emails sent by this plugin are orthogonal to Trac's `ALWAYS_NOTIFY_UPDATER`, `ALWAYS_NOTIFY_OWNER` and `ALWAYS_NOTIFY_REPORTER` … … 23 23 24 24 If you have any issues, create a 25 [http://trac-hacks.org/newticket?component=WorkflowNotificationPlugin&owner=ejucovy new ticket]. 25 [/newticket?component=WorkflowNotificationPlugin new ticket]. 26 27 [[TicketQuery(component=WorkflowNotificationPlugin&group=type,format=progress)]] 26 28 27 29 == Download … … 36 38 37 39 Install the plugin's source code: 38 {{{ 39 #!sh 40 {{{#!sh 40 41 easy_install trac-WorkflowNotificationPlugin 41 42 }}} 42 43 43 44 Enable its components in `trac.ini`: 44 {{{ 45 #!ini 45 {{{#!ini 46 46 [components] 47 47 workflow_notification.* = enabled … … 49 49 50 50 Add its component to your list of workflow providers, after all other workflow providers, for example: 51 {{{ 52 #!ini 51 {{{#!ini 53 52 [ticket] 54 53 workflow = ConfigurableTicketWorkflow, TicketWorkflowNotifier … … 64 63 65 64 Within this section, each entry is a notification email that may be sent out for a ticket. Here is an example: 66 {{{ 67 #!ini 65 {{{#!ini 68 66 [ticket-workflow-notifications] 69 67 notify_reporter_when_accepted = accept … … 76 74 77 75 We could also define a notification to occur on multiple workflow actions, using a comma separated list of workflow actions: 78 {{{ 79 #!ini 76 {{{#!ini 80 77 notify_owner_changed = accept, reassign 81 78 }}} … … 90 87 91 88 The `.recipients` definition should be a Genshi template that renders to a comma separated list of email addresses and/or usernames known to Trac. In the above example we combine a dynamic variable based on the ticket's current state, a username known to Trac, and a hard coded email address: 92 {{{ 93 #!ini 89 {{{#!ini 94 90 notify_reporter_when_accepted.recipients = ${ticket.reporter}, trac-admin@hostname.com, trac_user 95 91 }}} … … 103 99 One use for this would be sending a notification when a ticket is resolved 'fixed': 104 100 105 {{{ 106 #!ini 101 {{{#!ini 107 102 [ticket-workflow-notifications] 108 103 when_fixed = resolve … … 115 110 But you could get as complex as you want with this feature: 116 111 117 {{{ 118 #!ini 112 {{{#!ini 119 113 magic_word.condition = ${'notifyme' in change.comment and change.author != ticket.reporter} 120 114 }}} 121 115 122 {{{ 123 #!ini 116 {{{#!ini 124 117 owner_changed.condition = ${old_values.owner != ticket.owner} 125 118 }}} … … 131 124 You can also configure notifications to be triggered when a ticket is newly created. To do this, use the special workflow action `@created` like so: 132 125 133 {{{ 134 #!ini 126 {{{#!ini 135 127 [ticket-workflow-notifications] 136 128 new_ticket = @created … … 144 136 You can also set the special value `*` for a notification, which means it will be triggered on every workflow action. However it will not be triggered by ticket creation: 145 137 146 {{{ 147 #!ini 138 {{{#!ini 148 139 [ticket-workflow-notifications] 149 140 ticket_changed = * … … 154 145 155 146 To trigger a notification for every workflow action as well as ticket creation, just specify both: 156 {{{ 157 #!ini 147 {{{#!ini 158 148 [ticket-workflow-notifications] 159 149 ticket_changed = *, @created … … 164 154 A workflow action always occurs when a ticket is changed, even if the user doesn't explicitly select a workflow action! In the standard Trac configuration, the default action is "leave". So you could set up a notification like so: 165 155 166 {{{ 167 #!ini 156 {{{#!ini 168 157 same_status = leave 169 158 same_status.body = View the ticket here: ${link} … … 178 167 179 168 You can use this dictionary to set up a notification similar to Trac's built in ticket change email, for example: 180 {{{ 181 #!ini 169 {{{#!ini 182 170 [ticket-workflow-notifications] 183 171 ticket_changed = *