Interesting! I will definitely look into this! Thanks!

On Monday, May 17, 2021 at 3:57:48 PM UTC-4 RjOllos wrote:

> On Monday, May 17, 2021 at 12:52:18 PM UTC-7 aiki...@gmail.com wrote:
>
>> Hi!
>>
>> I have written a few simple custom plugins for Trac that all meet my 
>> simple needs up until this point. However, now I'm reaching a limit of 
>> sorts...
>>
>> I understand that Trac 1.4.2 uses Jinja2 templates and that I can edit 
>> those templates in order to alter the contents of the outgoing email. 
>> However, I find the templates hard to read and hard to maintain; given that 
>> I do not know (nor have the time to deeply learn) Jinja2 templates.
>>
>> My situation...
>>
>> I have a python cron job that runs weekly and collects ticket information 
>> from a few Trac projects. It uses a static html header and static html 
>> footer; both in their own files. This allows me to both easily improve the 
>> header/footer over timeor swap them out for something else entirely.
>>
>> What I'm looking for...
>>
>> I'd like to make use of my static header/footer files and change the 
>> email notifications coming out of Trac from plain text to html. I'd also 
>> like to modify the contents of the outgoing email in order to simplify the 
>> contents so that when a ticket is modified a very simplistic email is sent.
>>
>> I imagine that it is best to create a custom python plugin. If so, what 
>> interface(s) would be best for me to implement and what should I do to turn 
>> off the Jinja2 email template? If not, what might be a better solution?
>>
>> Any and all thoughts to help me build a custom (simple) email would be 
>> very much appreciated!
>>
>> Kindly,
>> Aikido Guy
>>
>> PS I've been using Trac for quite a few years and think it is great! A 
>> job well done in my view! Thank you!
>>
>
> You could use this plugin:
> https://trac-hacks.org/wiki/TracHtmlNotificationPlugin
>
> But if you want to modify the template you'll need to copy the template to 
> the environment templates dir and modify it:
>
> https://trac-hacks.org/browser/trachtmlnotificationplugin/0.12/trachtmlnotification/templates/jinja2/htmlnotification_ticket.html
> https://trac-hacks.org/wiki/TracHtmlNotificationPlugin 
>
> The include tag may be useful:
> https://jinja.palletsprojects.com/en/3.0.x/templates/#include
>
> 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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/de5eeff6-6cef-412f-9aba-54cd2fb43ffan%40googlegroups.com.

Reply via email to