Opened 6 years ago

Closed 3 years ago

Update the HTML notification patch for Trac 0.12 release

Reported by: Owned by: Drops akarzim normal TracHtmlNotificationPatch normal Trac 0.12 notification jun66j5 0.12

The patch needs to be updated for Trac 0.12.

Changed 6 years ago by Drops

HTML notification patch for Trac 0.12

comment:1 Changed 6 years ago by Drops

• Summary changed from Update the HTML notification path for Trac 0.12 release to Update the HTML notification patch for Trac 0.12 release
• Trac Release changed from 0.11 to 0.12

Changed 6 years ago by Drops

HTML notification patch for Trac 0.12 files

comment:2 Changed 6 years ago by Drops

I also added small change for Authors name prefix in From e-mail field instead of static label defined by 'smtp_from_name' in Trac config. See Trac/notification.py file.

--- D:/Install/Trac/Trac-12.0/Plugins/Notification/org/Trac/notification.py Wed Aug 11 14:26:44 2010
@@ -309,7 +309,10 @@
return
+        #DNK I prefer to have "Authors name" prefix in the From e-mail field instead of static label defined by 'smtp_from_name' in Trac config
+        self.from_name =  self.data['change']['author'] + ' ' + self.config['notification'].get('smtp_from_name')
+        #DNK end
if not self.from_email and not self.replyto_email:


comment:3 follow-up: ↓ 4 Changed 6 years ago by larachan

• Type changed from enhancement to defect

i still can't get this to work... still receiving notification messages in plain text...

comment:4 in reply to: ↑ 3 Changed 6 years ago by Drops

i still can't get this to work... still receiving notification messages in plain text...

I am sorry, patch file is not full, it is still needs patch for ..\Trac0.12-HtmlNotificationFiles\new\Trac\ticket\notification.py. You can use zip file to do correct patch.

missig diff file

comment:5 follow-up: ↓ 9 Changed 6 years ago by christophe@…

This is a very fine patch.

However, the comments are allowed to include wiki formatting, which isn't applied when it is sent.

How would it be possible to add this functionality ?

comment:6 Changed 5 years ago by rjollos

• Description modified (diff)

comment:7 follow-up: ↓ 8 Changed 5 years ago by jypark@…

I replaced the my files(notification.py and ticket_notify_email.txt ) with your patch. And then I restarted web server but the patch isn't applied. How can I solve this problem? Please let me know. Please Help~

comment:8 in reply to: ↑ 7 Changed 5 years ago by jypark@…

I replaced the my files(notification.py and ticket_notify_email.txt ) with your patch. And then I restarted web server but the patch isn't applied. How can I solve this problem? Please let me know. Please Help~

I guess something wrong in the cache.
The cache where is in my path(D:\trac\.egg-cache), in whitch there are old ticket_notify_email.txt file.
(for example in my case : D:\trac\.egg-cache\trac-0.12.1-py2.5-win32.egg-tmp\trac\ticket\templates\ticket_notify_email.txt)

comment:9 in reply to: ↑ 5 Changed 5 years ago by rlrj60

This is a very fine patch.

However, the comments are allowed to include wiki formatting, which isn't applied when it is sent.

How would it be possible to add this functionality ?

You might want to look at the patch on #5922 to have comment in html format.

comment:10 Changed 5 years ago by sailorickm

I'm having the same problem mentioned by others. I applied the patch (for trac 0.11.4) and restarted the server, but I still get the same plain text email as before.

Any idea what is wrong?

This is on a Linux machine, hosted with a commercial provider (DreamHost). I had them restart the apache server. I believe they really did it. I received this email from them:

I've restarted the apache servers per your request. Here's the status:

Current Time: Tuesday, 15-Mar-2011 14:43:05 PDT Restart Time: Tuesday, 15-Mar-2011 14:42:58 PDT Server uptime: 7 seconds

Any help or ideas would be appreciated!

comment:11 Changed 5 years ago by martin.fernholz@…

We are working on TRAC 0.12.2. I changed the files from our system with the files from the zip-file. Then I restart the apache and create a new ticket. When I send the ticket I get a warning in a yellow box sounds like: "Ticket was created but there was an error when sending the notification with :'author'. This is from the trac error-log: Trac[web_ui] ERROR: Failure sending notification on creation of ticket #12: KeyError: 'author' Any ideas?

comment:12 Changed 5 years ago by anonymous

Martin, you should undo my change in http://trac-hacks.org/ticket/7474#comment:2

self.from_name =  self.data['change']['author']...


In Trac 0.12 there is not 'auhtor' when initial ticket created. Must be:

self.from_name = self.config['notification'].get('smtp_from_name')


comment:13 Changed 5 years ago by Drops

There is also patch for Trac 0.13, see Ticket #8360 to support Author name in From.

comment:14 Changed 5 years ago by jnankin@…

headers['Content-Type'] = 'text/html; charset="utf-8"'


I'm running 0.12 and this was NOT in the zip file I downloaded that's attached to this ticket.

comment:15 Changed 5 years ago by jnankin@…

sorry, that should be:

headers['Content-Type'] = 'text/html; charset="utf-8"'


comment:16 Changed 3 years ago by rjollos

• Cc jun66j5 added; anonymous removed
• Resolution set to wontfix
• Status changed from new to closed

I think we can close this and direct users to the TracHtmlNotificationPlugin. jun66j5: does that seem correct to you?

Fine by me.