Changes between Version 3 and Version 4 of WorkflowNotificationPlugin
- Timestamp:
- Dec 10, 2012, 1:49:22 PM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WorkflowNotificationPlugin
v3 v4 84 84 [ticket-workflow-notifications] 85 85 notify_reporter_when_accepted = accept 86 notify_reporter_when_accepted.body = Hi $ticket.reporter, '$ticket.summary' has been accepted by $change.author. Its status is now $ticket.status.\n\n{% if change.comment %}$change.author said:\n\n$change.comment{% end %}-----\nTicket URL: $link\n$project.name <${project.url or abs_href()}>\n$project.descr 86 notify_reporter_when_accepted.body = Hi $ticket.reporter, '$ticket.summary' has been accepted 87 by $change.author. Its status is now $ticket.status. 88 89 {% if change.comment %}$change.author said: 90 $change.comment{% end %} 91 ----- 92 Ticket URL: $link 93 $project.name <${project.url or abs_href()}> 94 $project.descr 87 95 notify_reporter_when_accepted.recipients = $ticket.reporter, trac-admin@hostname.com, trac_user 88 96 notify_reporter_when_accepted.subject = '$ticket.summary' is now accepted … … 149 157 150 158 You can also set the special value `*` for a notification, which means 151 it will be triggered on every workflow action including ticket creation: 159 it will be triggered on every workflow action. However it will not be 160 triggered by ticket creation: 152 161 153 162 {{{ … … 159 168 }}} 160 169 161 ==== Notifications for the when no action has occurred ==== 170 To trigger a notification for every workflow action as well as ticket 171 creation, just specify both: 172 {{{ 173 [ticket-workflow-notifications] 174 ticket_changed = *, @created 175 }}} 176 177 ==== Notifications when no action has occurred ==== 162 178 163 179 A workflow action always occurs when a ticket is changed, even if the user … … 172 188 }}} 173 189 190 ==== Accessing old ticket values ===== 191 192 The ticket's old values are available in the notification templates. 193 These values are provided in a Python dict named `old_values`. The 194 values provided are from before any changes were made to the ticket, 195 whether by workflow operations or by direct user action. 196 197 You can use this dictionary to set up a notification similar to Trac's 198 built in ticket change email; for example: 199 {{{ 200 [ticket-workflow-notifications] 201 ticket_changed = * 202 ticket_changed.body = Ticket changed by $change.author: $change.comment 203 {% for field in old_ticket %}{% if old_ticket[field] != ticket[field] %} 204 $field changed: ${old_ticket[field]} => ${ticket[field]}{% end %}{% end %} 205 ticket_changed.recipients = $ticket.reporter 206 ticket_changed.subject = Ticket $ticket.id has changed! 207 }}} 174 208 175 209 == Recent Changes ==