Ticket #2625 (new enhancement)
Opened 6 years ago
Last modified 4 months ago
Add option to send HTML mail messages
| Reported by: | tomek.piatek@… | Owned by: | eblot |
|---|---|---|---|
| Priority: | normal | Milestone: | next-major-0.1X |
| Component: | notification | Version: | 0.11-stable |
| Severity: | normal | Keywords: | notification email |
| Cc: | mail@…, ander.tenno@…, broohaha@…, s.mitchell@…, lewis.francis@…, c00i90wn@…, m@…, benjamin.azan@…, diego.gentoo@…, daniel.oconnor@…, nicolas@…, jetcat@…, dbytesguard-trackhacks@…, ericacm@…, alejandro.popov@…, ryano@…, christophe.prevost@…, isaacsutherland@…, bill@…, the3illings@…, olle@…, kofal002@…, macke@… | ||
| Release Notes: | |||
| API Changes: | |||
Description
It would be nice if Trac was able to send notification emails in some sort of rich format, for example HTML. This way one would not have to use fixed fonts in the mail client.
Attachments
Change History
comment:1 Changed 6 years ago by eblot
- Keywords notification email added
comment:2 Changed 6 years ago by anonymous
comment:3 Changed 6 years ago by Peter Bruin
I agree that ideally the email would look something like the ticket page. This is especially usefull for my case where we have non software developers fill in tickets. They always complain that the get some funny looking emails. I use Thunderbird and the mails look ok but when I use Outlook the get all distorted. Sending in HTML will solve this setting related issue, sending it looking like the ticket page is the icing on the cake.
comment:4 Changed 6 years ago by eblot
peter: have you tried the latest trunk [2799]+ to check if it improves the ticket rendering in Outlook (have a look at the TracNotification page for the options).
comment:5 Changed 6 years ago by ander.tenno@…
Add my vote to the people who would like to see notification emails in rich text format. Any plans for this?
comment:6 Changed 6 years ago by anonymous
- Cc ander.tenno@… added
comment:7 Changed 6 years ago by Russell Hind <rhind@…>
- Cc rhind@… added
I'm not too worried about html format, but we're now forced to use Outlook 2003 at work, and it wraps the e-mail message very early (i.e. the lines of '-' above and below the summary are wrapped from about 3/4 of the way along which looks fairly message.
Is there another way to stop outlook wrapping like this? That way I'd be quite happy with the plain test messages.
Cheers
Russell
comment:8 Changed 6 years ago by ander.tenno@…
Text messages start to be a problem when Wiki is used. Then you do get very funny looking emails.
comment:9 Changed 6 years ago by anonymous
- Cc broohaha@… added
comment:10 Changed 6 years ago by anonymous
- Cc s.mitchell@… added
comment:11 Changed 6 years ago by lewis.francis@…
- Cc lewis.francis@… added
Add my voice to the chorus -- requiring my users to force a monospace font is not going to go over very well.
comment:12 Changed 6 years ago by oscarmv@…
Add another vote. Plus an option to send attachments in the notification e-mail when they are added to the ticket (should I file another ticket for that?)
comment:13 Changed 6 years ago by c00i90wn <c00i90wn@…>
- Cc c00i90wn@… added
comment:14 Changed 6 years ago by Willem Kokke <mail@…>
- Cc mail@… added
Definately interested in this one (got here by searching for the option)
I use it alot to send C++ code snippets around, and it looks just unreadable in email.
comment:15 Changed 5 years ago by Markus Tacker <m@…>
- Cc m@… added
comment:16 Changed 5 years ago by benjamin.azan@…
- Cc benjamin.azan@… added
This improvement would be extremly usefull.
comment:17 Changed 5 years ago by eblot
See also #4516
comment:18 Changed 5 years ago by cboos
- Component changed from general to notification
- Milestone set to 0.12
- Owner changed from jonas to eblot
+ this should also be a user preference.
comment:20 in reply to: ↑ 19 Changed 5 years ago by eblot
Replying to diego.gentoo@gmail.com:
Any news?
Since yesterday and the discussion you initiated?
http://groups.google.com/group/trac-users/browse_thread/thread/50b20a8fdc262769
comment:21 follow-up: ↓ 22 Changed 4 years ago by anonymous
+ 10 more votes from me and my team. I didn't use trac for a long time because of silly unprofessional things like this (and the insistance on SQLite and the installation hastles of the templating engine). It's getting better and better but just needs a bit of polishing around the edges. Trac already has the processing engine to convert wiki markup to HTML, why not just reuse that in generating notification emails?
comment:22 in reply to: ↑ 21 Changed 4 years ago by eblot
Replying to anonymous:
+ 10 more votes from me and my team. I didn't use trac for a long time because of silly unprofessional things like this (and the insistance on SQLite and the installation hastles of the templating engine). It's getting better and better but just needs a bit of polishing around the edges. Trac already has the processing engine to convert wiki markup to HTML, why not just reuse that in generating notification emails?
It will be done, hopefully for 0.12. It's not as "simple" as it may look, dealing with multipart emails that work properly with all (major) email clients is not straightforward.
I won't comment on the "silly unprofesionnal" things as it would be off-topic and useless.
comment:23 Changed 4 years ago by daniel.oconnor@…
- Cc daniel.oconnor@… added
comment:24 Changed 4 years ago by Nicolas Marchildon <nicolas@…>
- Cc nicolas@… added
comment:25 Changed 4 years ago by PP Edenburg
Yes, I like the feature to be able to send more formatted emails as well. You got my vote!
comment:26 Changed 4 years ago by Kamil Kisiel <kamil@…>
- Version changed from 0.9.3 to 0.11-stable
Another vote for this feature. This would greatly improve the usability of ticket emails.
As it stands, seeing a bunch of wiki markup in your email message is often a bit... well.. horrible.. especially if it is complicated.
comment:27 Changed 4 years ago by rhind@…
- Cc rhind@… removed
comment:28 Changed 4 years ago by jetcat@…
- Cc jetcat@… added
comment:29 Changed 3 years ago by diroussel+trac@…
We don't need votes, we need working code. If you'd like this feature please have a go at implementing it and submit your patches here. Please mention which email clients you have tested with.
Ideally it should work with Outlook, Thunderbird, Apple Mail Gmail and others. But that can be hard to achieve.
Useful links:
comment:30 Changed 3 years ago by dbytesguard-trackhacks@…
- Cc dbytesguard-trackhacks@… added
Has anyone tried the AnnouncerPlugin? It is a bit of a hack but it works for me with Outlook 2003. It uses Genshi to create the html and sends a text alternative... also gened by Genshi... sadly it pretty much re-implements the whole trac notification system. It would be nice if Trac supported all this.
comment:31 follow-up: ↓ 35 Changed 3 years ago by trac-html-notification@…
I've written a little tutorial in order to recieve HTML email notification with Trac 0.11. It's perfectible but it does the trick until an official support ! You can find it on http://trac-html-notification.alwaysdata.net
regards,
Akarzim
comment:32 Changed 3 years ago by ericacm@…
- Cc ericacm@… added
comment:33 Changed 3 years ago by anonymous
- Cc alejandro.popov@… added
comment:34 Changed 2 years ago by Ryan Ollos <ryano@…>
- Cc ryano@… added
comment:35 in reply to: ↑ 31 Changed 2 years ago by anonymous
Replying to trac-html-notification@…:
I've written a little tutorial in order to recieve HTML email notification with Trac 0.11. It's perfectible but it does the trick until an official support ! You can find it on http://trac-html-notification.alwaysdata.net
regards,
Akarzim
Can you send me your notification.py and ticket_notification_email.txt files for me ?
I can't patch successfully in my trac.
comment:36 Changed 2 years ago by christophe.prevost@…
- Cc christophe.prevost@… added
comment:37 Changed 2 years ago by Ryan Ollos <ryano@…>
I have been told that the plan is to merge the th:AnnouncerPlugin into Trac in 0.13. I'm not sure if this plan is documented anywhere. Perhaps someone knowledgeable on the plan can elaborate.
comment:38 Changed 22 months ago by rcorsaro
The plan is to come up with a plan. We've started on TracDev/Proposals/Announcer. I think there is still a fair amount of work to be done.
comment:40 Changed 17 months ago by Isaac Sutherland <isaacsutherland@…>
- Cc isaacsutherland@… added
comment:41 Changed 11 months ago by bill@…
- Cc bill@… added
comment:42 Changed 10 months ago by the3illings@…
- Cc the3illings@… added
Are there any plan to get that running in a 0.12.x or 0.13?
comment:43 Changed 10 months ago by cboos
Sorry, no. This feature is on the long term plan.
comment:44 Changed 8 months ago by Olle <olle@…>
- Cc olle@… added
comment:45 Changed 7 months ago by kofal002@…
- Cc kofal002@… added
Definitely a desired feature; if anything, at least allow a sane way to change the notification's Content-Type. This incredibly simple option took me several hours investigating & patching files instead of just writing a line to trac.ini. Ridiculous.
Relevant resource (from freakin' 2007):
http://rickosborne.org/blog/2007/06/getting-trac-to-send-out-html-emails/
comment:46 follow-ups: ↓ 47 ↓ 49 Changed 5 months ago by Benjamin Saberin <ben@…>
Lots of solutions on this page. I'll add mine here. My goal was to modify the original PY scripts as little as possible.
Modified 'pyshared/trac/notification.py'
Original:
386 msg = MIMEText(body, 'html')
New:
386 msg = MIMEText(body, 'text')
Modified 'pyshared/trac/ticket/notification.py'
Added:
306 hdrs['Content-Type'] = 'text/html; charset=utf-8' 307 hdrs['PreferredFormat'] = 'text/html'
I copied ticket_notify_email.txt to my custom templates folder (set in trac.ini). My first draft, before all my awesome html formatting, works by adding this to the top of the file:
001 <html><body><pre>
and this to the bottom of the file:
020 </pre></body><html>
In my final template, I only left the <pre> wrapper around the $ticket_props part of the template. Everything else received html tags with styling.
I'm considering adding format_props_html. But the <pre> forces a fixed-width font, which solves my issue for now.
Hope this helps someone.
comment:47 in reply to: ↑ 46 Changed 5 months ago by Benjamin Saberin <ben@…>
My "Original" and "New" modifications for "Modified 'pyshared/trac/notification.py'" lines are inverted.
Replying to Benjamin Saberin <ben@…>:
Lots of solutions on this page. I'll add mine here. My goal was to modify the original PY scripts as little as possible.
Modified 'pyshared/trac/notification.py'
Original:
386 msg = MIMEText(body, 'html')New:
386 msg = MIMEText(body, 'text')Modified 'pyshared/trac/ticket/notification.py'
Added:
306 hdrs['Content-Type'] = 'text/html; charset=utf-8' 307 hdrs['PreferredFormat'] = 'text/html'I copied ticket_notify_email.txt to my custom templates folder (set in trac.ini). My first draft, before all my awesome html formatting, works by adding this to the top of the file:
001 <html><body><pre>and this to the bottom of the file:
020 </pre></body><html>In my final template, I only left the <pre> wrapper around the $ticket_props part of the template. Everything else received html tags with styling.
I'm considering adding format_props_html. But the <pre> forces a fixed-width font, which solves my issue for now.
Hope this helps someone.
comment:48 Changed 4 months ago by Marcus Lindblom Sonestedt <macke@…>
- Cc macke@… added
comment:49 in reply to: ↑ 46 ; follow-up: ↓ 50 Changed 4 months ago by ivan@…
Replying to Benjamin Saberin <ben@…>:
Lots of solutions on this page. I'll add mine here. My goal was to modify the original PY scripts as little as possible.
Hello,
I changed everything that you wrote down and I have customnotification with added html tags (bold, font style and ect..) BUT still in recieved mail header I have "plain text". Do I have to made new pyc and pyo files from existing (modified)? I have trac 0.12 and pyton 2.4.
Thank you.
comment:50 in reply to: ↑ 49 Changed 4 months ago by anonymous
Replying to ivan@…:
I changed everything that you wrote down and I have customnotification with added html tags (bold, font style and ect..) BUT still in recieved mail header I have "plain text". Do I have to made new pyc and pyo files from existing (modified)? I have trac 0.12 and pyton 2.4.
Anywhere the phrase
hdrs['Content-Type']
Appears you need to change it from plain text to 'text/html; charset=utf-8', so you can just grep the source code for the above phrase. In comment 45 I linked a guide to modifying the source code which is still relevant.



Ideally the notification message would look exactly the same as the ticket page. At the moment if I use wiki markup in the ticket comment I get raw markup in the notification message.