Changes between Version 13 and Version 14 of TracNotification


Ignore:
Timestamp:
14/06/2017 12:47:21 (7 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TracNotification

    v13 v14  
    3434These are the available options for the `[notification]` section in trac.ini:
    3535
    36 [[TracIni(notification)]]
     36[[TracIni(section=notification)]]
    3737
    3838=== Example Configuration (SMTP)
     
    6060The default subscriptions are configured in the `[notification-subscriber]` section in trac.ini:
    6161
    62 [[TracIni(notification-subscriber)]]
     62[[TracIni(section=notification-subscriber)]]
    6363
    6464Each user can override these defaults in his ''Notifications'' preferences.
    6565
    6666For example to unsubscribe from notifications for one's own changes and comments, the rule "Never notify: I update a ticket" should be added above other subscription rules.
     67
     68The subscription rule name on the left side of the `=` can be anything, it has no meaning outside this configuration file. The subscriber name on the right side of the `=` must be one of the subscribers listed in the above table.
     69
     70The following attributes of default subscriptions can be configured:
     71* `.distributor` (Default: `email`)
     72  * Other values require plugins. For example `on-site` requires th:OnSiteNotificationsPlugin.
     73* `.priority` (Default: `100`)
     74  * Smaller values override larger values.
     75  * If you use `0`, then users will not be able to override this rule.
     76* `.adverb` (Default: `always`)
     77  * `never` can be used to silence other subscription rules with higher values.
     78* `.format` (Default: `text/plain`)
     79  * Other values require plugins. For example `text/html` requires th:TracHtmlNotificationPlugin.
     80
     81=== Example Configuration (default subscriptions)
     82{{{#!ini
     83[notification-subscriber]
     84always_notify_owner = TicketOwnerSubscriber
     85always_notify_owner.distributor = email
     86always_notify_owner.priority = 100
     87always_notify_owner.adverb = always
     88always_notify_owner.format = text/plain
     89
     90always_notify_previous_updater = TicketPreviousUpdatersSubscriber
     91
     92never_notify_updater = TicketUpdaterSubscriber
     93never_notify_updater.adverb = never
     94never_notify_updater.priority = 0
     95
     96notify_cc_html = CarbonCopySubscriber
     97notify_cc_html.format = text/html
     98}}}
    6799
    68100=== Customizing the e-mail subject
    69101The e-mail subject can be customized with the `ticket_subject_template` option, which contains a [http://genshi.edgewall.org/wiki/Documentation/text-templates.html Genshi text template] snippet. The default value is:
    70102{{{#!genshi
    71 $prefix #$ticket.id: $summary
     103${prefix} #${ticket.id}: ${summary}
    72104}}}
    73105The following variables are available in the template:
     
    76108 * `prefix`: The prefix defined in `smtp_subject_prefix`.
    77109 * `summary`: The ticket summary, with the old value if the summary was edited.
    78  * `ticket`: The ticket model object (see [trac:source:/trunk/trac/ticket/model.py model.py]). Individual ticket fields can be addressed by appending the field name separated by a dot, eg `$ticket.milestone`.
     110 * `ticket`: The ticket model object (see [trac:source:/trunk/trac/ticket/model.py model.py]). Individual ticket fields can be addressed by appending the field name separated by a dot, eg `${ticket.milestone}`.
    79111
    80112=== Customizing the e-mail content
     
    83115
    84116{{{#!genshi
    85 $ticket_body_hdr
    86 $ticket_props
     117${ticket_body_hdr}
     118${ticket_props}
    87119{% choose ticket.new %}\
    88120{%   when True %}\
    89 $ticket.description
     121${ticket.description}
    90122{%   end %}\
    91123{%   otherwise %}\
     
    93125${_('Changes (by %(author)s):', author=change.author)}
    94126
    95 $changes_body
     127${changes_body}
    96128{%     end %}\
    97129{%     if changes_descr %}\
     
    99131${_('Description changed by %(author)s:', author=change.author)}
    100132{%       end %}\
    101 $changes_descr
     133${changes_descr}
    102134--
    103135{%     end %}\
     
    106138${changes_body and _('Comment:') or _('Comment (by %(author)s):', author=change.author)}
    107139
    108 $change.comment
     140${change.comment}
    109141{%     end %}\
    110142{%   end %}\
     
    113145--
    114146${_('Ticket URL: <%(link)s>', link=ticket.link)}
    115 $project.name <${project.url or abs_href()}>
    116 $project.descr
     147${project.name} <${project.url or abs_href()}>
     148${project.descr}
    117149}}}
    118150
     
    149181Replace the following second row in the template:
    150182{{{
    151 $ticket_props
     183${ticket_props}
    152184}}}
    153185