1

In Trac 0.12, one has the ability to change the contents of email notifications and I am trying to simplify the template to only include the changes, like

{% choose ticket.new %}\
{%   when True %}\
$ticket_body_hdr
$ticket_props
$ticket.description
{%   end %}\
{%   otherwise %}\
{%     if changes_body %}\
${_('Changes (by %(author)s):', author=change.author)}

$changes_body
{%     end %}\
{%     if changes_descr %}\
{%       if not changes_body and not change.comment and change.author %}\
${_('Description changed by %(author)s:', author=change.author)}
{%       end %}\
$changes_descr
--
{%     end %}\
{%     if change.comment %}\

${changes_body and _('Comment:') or _('Comment (by %(author)s):', author=change.author)}

$change.comment
{%     end %}\
{%   end %}\
{% end %}\
-- 
${_('Ticket URL: <%(link)s>', link=ticket.link)}

But where do I find a reference for the language that the template written in? And how to I put in a comment that can hold a revision-control expansion like $Id$?

jpsecher
  • 4,461
  • 2
  • 33
  • 42
  • I'd like to answer your second question too, but what exactly do you expect to see by $Id$? Could you be more detailed, i.e. with an example content, please? – hasienda Oct 21 '11 at 19:04
  • Thanks for your answer, it led to the solution. I have edited your answer a week ago, but it awaits approval -- I do not know from whom. The condensed answer is to use comments like this: {# $Id$ #} – jpsecher Oct 28 '11 at 11:22

1 Answers1

3

Trac uses Genshi for templates in two different forms: XML and text.

I've never used TracNotification, but what you post is a text template. Documentation for it can be found at the Genshi wiki.

hasienda
  • 2,390
  • 1
  • 13
  • 16