Mailing List Archive

Simplify the emails coming out of trac
Hi,

I've read https://trac.edgewall.org/wiki/TracNotification#CustomizingContent and
the associated CookBook but I find it hard to know how to do what I want.

I'd like to simplify the content of the emails (if possible).

For example,
1) When a new ticket is created then the email might only say "New ticket
XXX is ready for you in project YYY" and ignore all of the other bits and
pieces.
2) When that ticket moves from state AA to state BB then the email should
say something like "Ticket XXX is now in state BB"

What might be the easiest/best way to achieve this?

Kindly,
Aikido Guy

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/043fa4dd-360b-4a51-89d6-f09299d9ca22n%40googlegroups.com.
Re: Simplify the emails coming out of trac [ In reply to ]
On Monday, December 7, 2020 at 2:00:38 PM UTC-8 aiki...@gmail.com wrote:

> Hi,
>
> I've read
> https://trac.edgewall.org/wiki/TracNotification#CustomizingContent and
> the associated CookBook but I find it hard to know how to do what I want.
>
> I'd like to simplify the content of the emails (if possible).
>
> For example,
> 1) When a new ticket is created then the email might only say "New ticket
> XXX is ready for you in project YYY" and ignore all of the other bits and
> pieces.
> 2) When that ticket moves from state AA to state BB then the email should
> say something like "Ticket XXX is now in state BB"
>
> What might be the easiest/best way to achieve this?
>
> Kindly,
> Aikido Guy
>

I would do these steps:

1. Fetch the template and put it in $env/templates
wget https://trac.edgewall.org/export/17482/tags/trac-1.4.2/trac/ticket/templates/ticket_notify_email.txt
\
-P $env/templates/

2. Restart web server

3. Confirm notifications work

4. Make a minor edit to $env/templates/ticket_notify_email.txt

5. Restart web server

6. Confirm your change has taken affect

Then it should be straightforward to remove the items from the template you
don't want. Slightly harder will be to add new stuff, but there is a lot of
documentation on Jinja2:

https://jinja.palletsprojects.com/en/2.11.x/templates/
https://trac.edgewall.org/wiki/TracDev/PortingFromGenshiToJinja#Changesinthetemplatesyntax
https://trac.edgewall.org/wiki/TracDev/Proposals/Jinja

Ryan

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/d9d26895-ff6e-4015-92aa-8d162871d096n%40googlegroups.com.