Changes between Version 6 and Version 7 of TracNotification


Ignore:
Timestamp:
07/28/2020 06:19:41 AM (2 weeks ago)
Author:
trac
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • TracNotification

    v6 v7  
    9898}}}
    9999
    100 === Customizing the e-mail subject
    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:
     100=== Customizing the email subject
     101The email subject can be customized with the `ticket_subject_template` option, which contains a [https://genshi.edgewall.org/wiki/Documentation/text-templates.html Genshi text template] snippet. The default value is:
    102102{{{#!genshi
    103103${prefix} #${ticket.id}: ${summary}
     
    105105The following variables are available in the template:
    106106
    107  * `env`: The project environment object (see [trac:source:/trunk/trac/env.py env.py]).
     107 * `env`: The project environment object (see [trac:source:branches/1.2-stable/trac/env.py env.py]).
    108108 * `prefix`: The prefix defined in `smtp_subject_prefix`.
    109109 * `summary`: The ticket summary, with the old value if the summary was edited.
    110  * `ticket`: The ticket model object (see [trac:source:/trunk/trac/ticket/model.py model.py]). Individual ticket fields can be accessed by appending the field name separated by a dot, eg `${ticket.milestone}`.
    111 
    112 === Customizing the e-mail content
    113 
    114 The notification e-mail content is generated based on `ticket_notify_email.txt` in `trac/ticket/templates`. You can add your own version of this template by adding a `ticket_notify_email.txt` to the templates directory of your environment. The default is:
     110 * `ticket`: The ticket model object (see [trac:source:branches/1.2-stable/trac/ticket/model.py model.py]). Individual ticket fields can be accessed by appending the field name separated by a dot, eg `${ticket.milestone}`.
     111
     112=== Customizing the email content
     113
     114The notification email content is generated based on `ticket_notify_email.txt` in `trac/ticket/templates`. You can add your own version of this template by adding a `ticket_notify_email.txt` to the templates directory of your environment. The default is:
    115115
    116116{{{#!genshi
    117 ${ticket_body_hdr}
    118 ${ticket_props}
    119 # if ticket.new:
    120 ${ticket.description}
    121 # else:
    122 #   if changes_body:
     117$ticket_body_hdr
     118$ticket_props
     119{% choose ticket.new %}\
     120{%   when True %}\
     121$ticket.description
     122{%   end %}\
     123{%   otherwise %}\
     124{%     if changes_body %}\
    123125${_('Changes (by %(author)s):', author=change.author)}
    124126
    125 ${changes_body}
    126 #   endif
    127 #   if changes_descr:
    128 #     if not changes_body and not change.comment and change.author:
     127$changes_body
     128{%     end %}\
     129{%     if changes_descr %}\
     130{%       if not changes_body and not change.comment and change.author %}\
    129131${_('Description changed by %(author)s:', author=change.author)}
    130 #     endif
    131 ${changes_descr}
     132{%       end %}\
     133$changes_descr
    132134--
    133 #   endif
    134 #   if change.comment:
    135 
    136 ${_('Comment:') if changes_body else
    137   _('Comment (by %(author)s):', author=change.author)}
    138 
    139 ${change.comment}
    140 #   endif
    141 # endif
    142 --
     135{%     end %}\
     136{%     if change.comment %}\
     137
     138${_('Comment:') if changes_body else _('Comment (by %(author)s):', author=change.author)}
     139
     140$change.comment
     141{%     end %}\
     142{%   end %}\
     143{% end %}\
     144
     145${'-- '}
    143146${_('Ticket URL: <%(link)s>', link=ticket.link)}
    144 ${project.name} <${project.url or abs_href()}>
    145 ${project.descr}
     147$project.name <${project.url or abs_href()}>
     148$project.descr
    146149}}}
    147150
     
    188191}}}
    189192
    190 where ''user'' and ''password'' match an existing GMail account, ie the ones you use to log in on [http://gmail.com].
     193where ''user'' and ''password'' match an existing GMail account, ie the ones you use to log in on [https://gmail.com].
    191194
    192195Alternatively, you can use `smtp_port = 25`.[[br]]