ticket notification - ticket_subject_template

14 views
Skip to first unread message

Clemens Feige

unread,
Feb 10, 2021, 6:49:42 PM2/10/21
to Trac Users
Hello

I am struggling with the `ticket_subject_template` option from the INI
file. What I want is a E-mail subject like so:

[TRAC] MyEnvironment ticket #123: bla bla summary

... but what I get is only the default value:

[TRAC] #123: bla bla description

The project/environment and the plain text "ticket" is missing.

I have configured as follows:

smtp_subject_prefix = [TRAC]
ticket_subject_template = ${prefix} ${env} ticket #${ticket.id}: ${summary}

According to the docu this is supposed to be a Jinja2-template.

https://trac.edgewall.org/wiki/TracIni#notification-ticket_subject_template-option

I have TRAC 1.4.2.

What is wrong?

Thanks
Clemens

Clemens Feige

unread,
Feb 11, 2021, 3:29:40 PM2/11/21
to Trac Users
I SOLVED the problem.

By mistake I had a second config option with same name
`ticket_subject_template`, which is why TRAC did not accept my other config.

Second, the config has to look as follows:

smtp_subject_prefix = [TRAC]
ticket_subject_template = ${prefix} ${env.project_name} ticket
#${ticket.id}: ${summary}

This will produce a subject as expected:

[TRAC] MyEnvironment ticket #123: bla bla summary

Clemens

RjOllos

unread,
Feb 11, 2021, 3:35:16 PM2/11/21
to Trac Users
On Thursday, February 11, 2021 at 12:29:40 PM UTC-8 Clemens Feige wrote:
Clemens wrote on 11.02.2021 at 00:49:
> Hello
>
> I am struggling with the `ticket_subject_template` option from the INI
> file. What I want is a E-mail subject like so:
>
> [TRAC] MyEnvironment ticket #123: bla bla summary
>
> ... but what I get is only the default value:
>
> [TRAC] #123: bla bla description
>
> The project/environment and the plain text "ticket" is missing.
>
> I have configured as follows:
>
> smtp_subject_prefix = [TRAC]
> ticket_subject_template = ${prefix} ${env} ticket #${ticket.id}: ${summary}
>
> According to the docu this is supposed to be a Jinja2-template.
>
> https://trac.edgewall.org/wiki/TracIni#notification-ticket_subject_template-option
>
>
> I have TRAC 1.4.2.
>
> What is wrong?
>
> Thanks
> Clemens
>

I SOLVED the problem.

By mistake I had a second config option with same name
`ticket_subject_template`, which is why TRAC did not accept my other config.

We've been able to solve that problem with the move to Python3, but there was no simple way to solve it in Python2:

Ryan 
Reply all
Reply to author
Forward
0 new messages