Changes between Version 7 and Version 8 of TracNotification
- Timestamp:
- 14/06/2017 12:47:29 (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracNotification
v7 v8 34 34 These are the available options for the `[notification]` section in trac.ini: 35 35 36 [[TracIni( notification)]]36 [[TracIni(section=notification)]] 37 37 38 38 === Example Configuration (SMTP) … … 60 60 The default subscriptions are configured in the `[notification-subscriber]` section in trac.ini: 61 61 62 [[TracIni( notification-subscriber)]]62 [[TracIni(section=notification-subscriber)]] 63 63 64 64 Each user can override these defaults in his ''Notifications'' preferences. 65 65 66 66 For 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 68 The 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 70 The 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] 84 always_notify_owner = TicketOwnerSubscriber 85 always_notify_owner.distributor = email 86 always_notify_owner.priority = 100 87 always_notify_owner.adverb = always 88 always_notify_owner.format = text/plain 89 90 always_notify_previous_updater = TicketPreviousUpdatersSubscriber 91 92 never_notify_updater = TicketUpdaterSubscriber 93 never_notify_updater.adverb = never 94 never_notify_updater.priority = 0 95 96 notify_cc_html = CarbonCopySubscriber 97 notify_cc_html.format = text/html 98 }}} 67 99 68 100 === Customizing the e-mail subject 69 101 The 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: 70 102 {{{#!genshi 71 $ prefix #$ticket.id: $summary103 ${prefix} #${ticket.id}: ${summary} 72 104 }}} 73 105 The following variables are available in the template: … … 76 108 * `prefix`: The prefix defined in `smtp_subject_prefix`. 77 109 * `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}`. 79 111 80 112 === Customizing the e-mail content … … 83 115 84 116 {{{#!genshi 85 $ ticket_body_hdr86 $ ticket_props117 ${ticket_body_hdr} 118 ${ticket_props} 87 119 {% choose ticket.new %}\ 88 120 {% when True %}\ 89 $ ticket.description121 ${ticket.description} 90 122 {% end %}\ 91 123 {% otherwise %}\ … … 93 125 ${_('Changes (by %(author)s):', author=change.author)} 94 126 95 $ changes_body127 ${changes_body} 96 128 {% end %}\ 97 129 {% if changes_descr %}\ … … 99 131 ${_('Description changed by %(author)s:', author=change.author)} 100 132 {% end %}\ 101 $ changes_descr133 ${changes_descr} 102 134 -- 103 135 {% end %}\ … … 106 138 ${changes_body and _('Comment:') or _('Comment (by %(author)s):', author=change.author)} 107 139 108 $ change.comment140 ${change.comment} 109 141 {% end %}\ 110 142 {% end %}\ … … 113 145 -- 114 146 ${_('Ticket URL: <%(link)s>', link=ticket.link)} 115 $ project.name<${project.url or abs_href()}>116 $ project.descr147 ${project.name} <${project.url or abs_href()}> 148 ${project.descr} 117 149 }}} 118 150 … … 149 181 Replace the following second row in the template: 150 182 {{{ 151 $ ticket_props183 ${ticket_props} 152 184 }}} 153 185