Changes between Version 17 and Version 18 of WorkflowNotificationPlugin


Ignore:
Timestamp:
Sep 9, 2015, 4:35:12 PM (9 years ago)
Author:
figaro
Comment:

Cosmetic changes, previous revision closes #12509

Legend:

Unmodified
Added
Removed
Modified
  • WorkflowNotificationPlugin

    v17 v18  
    55== Description
    66
    7 WorkflowNotificationPlugin enables flexible configuration of email notifications tied to ticket workflow changes.
     7This plugin enables flexible configuration of email notifications tied to ticket workflow changes.
    88
    99Administrators 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".
     
    1212to 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.
    1313
    14 The notification emails sent by this plugin respect Trac's ALWAYS_CC and ALWAYS_BCC settings.
     14The notification emails sent by this plugin respect Trac's `ALWAYS_CC` and `ALWAYS_BCC` settings.
    1515
    1616The notification emails sent by this plugin are orthogonal to Trac's `ALWAYS_NOTIFY_UPDATER`, `ALWAYS_NOTIFY_OWNER` and `ALWAYS_NOTIFY_REPORTER`
     
    2323
    2424If 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)]]
    2628
    2729== Download
     
    3638
    3739Install the plugin's source code:
    38 {{{
    39 #!sh
     40{{{#!sh
    4041easy_install trac-WorkflowNotificationPlugin
    4142}}}
    4243
    4344Enable its components in `trac.ini`:
    44 {{{
    45 #!ini
     45{{{#!ini
    4646[components]
    4747workflow_notification.* = enabled
     
    4949
    5050Add its component to your list of workflow providers, after all other workflow providers, for example:
    51 {{{
    52 #!ini
     51{{{#!ini
    5352[ticket]
    5453workflow = ConfigurableTicketWorkflow, TicketWorkflowNotifier
     
    6463
    6564Within 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
    6866[ticket-workflow-notifications]
    6967notify_reporter_when_accepted = accept
     
    7674
    7775We could also define a notification to occur on multiple workflow actions, using a comma separated list of workflow actions:
    78 {{{
    79 #!ini
     76{{{#!ini
    8077notify_owner_changed = accept, reassign
    8178}}}
     
    9087
    9188The `.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
    9490notify_reporter_when_accepted.recipients = ${ticket.reporter}, trac-admin@hostname.com, trac_user
    9591}}}
     
    10399One use for this would be sending a notification when a ticket is resolved 'fixed':
    104100
    105 {{{
    106 #!ini
     101{{{#!ini
    107102[ticket-workflow-notifications]
    108103when_fixed = resolve
     
    115110But you could get as complex as you want with this feature:
    116111
    117 {{{
    118 #!ini
     112{{{#!ini
    119113magic_word.condition = ${'notifyme' in change.comment and change.author != ticket.reporter}
    120114}}}
    121115
    122 {{{
    123 #!ini
     116{{{#!ini
    124117owner_changed.condition = ${old_values.owner != ticket.owner}
    125118}}}
     
    131124You can also configure notifications to be triggered when a ticket is newly created. To do this, use the special workflow action `@created` like so:
    132125
    133 {{{
    134 #!ini
     126{{{#!ini
    135127[ticket-workflow-notifications]
    136128new_ticket = @created
     
    144136You 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:
    145137
    146 {{{
    147 #!ini
     138{{{#!ini
    148139[ticket-workflow-notifications]
    149140ticket_changed = *
     
    154145
    155146To trigger a notification for every workflow action as well as ticket creation, just specify both:
    156 {{{
    157 #!ini
     147{{{#!ini
    158148[ticket-workflow-notifications]
    159149ticket_changed = *, @created
     
    164154A 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:
    165155
    166 {{{
    167 #!ini
     156{{{#!ini
    168157same_status = leave
    169158same_status.body = View the ticket here: ${link}
     
    178167
    179168You 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
    182170[ticket-workflow-notifications]
    183171ticket_changed = *