Modify

Opened 4 years ago

Closed 16 months ago

Last modified 16 months ago

#7474 closed defect (wontfix)

Update the HTML notification patch for Trac 0.12 release

Reported by: Drops Owned by: akarzim
Priority: normal Component: TracHtmlNotificationPatch
Severity: normal Keywords: Trac 0.12 notification
Cc: jun66j5 Trac Release: 0.12

Description (last modified by rjollos)

The patch needs to be updated for Trac 0.12.

Attachments (3)

ticket_notify_email_Trac-0.12.patch (12.1 KB) - added by Drops 4 years ago.
HTML notification patch for Trac 0.12
Trac0.12-HtmlNotificationFiles.zip (20.9 KB) - added by Drops 4 years ago.
HTML notification patch for Trac 0.12 files
Trac_ticket_notification.py.diff (8.0 KB) - added by Drops 4 years ago.
missig diff file

Download all attachments as: .zip

Change History (20)

Changed 4 years ago by Drops

HTML notification patch for Trac 0.12

comment:1 Changed 4 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 4 years ago by Drops

HTML notification patch for Trac 0.12 files

comment:2 Changed 4 years ago by Drops

I also added small change for Author`s 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
+++ D:/Install/Trac/Trac-12.0/Plugins/Notification/new/Trac/notification.py Wed Aug 11 14:20:58 2010
@@ -309,7 +309,10 @@
         if not self.config.getbool('notification', 'smtp_enabled'):
             return
         self.from_email = self.config['notification'].get('smtp_from')
-        self.from_name = self.config['notification'].get('smtp_from_name')
+        #DNK I prefer to have "Author`s name" prefix in the From e-mail field instead of static label defined by 'smtp_from_name' in Trac config
+        #self.from_name = self.config['notification'].get('smtp_from_name')
+        self.from_name =  self.data['change']['author'] + ' ' + self.config['notification'].get('smtp_from_name') 
+        #DNK end
         self.replyto_email = self.config['notification'].get('smtp_replyto')
         self.from_email = self.from_email or self.replyto_email
         if not self.from_email and not self.replyto_email:

comment:3 follow-up: Changed 4 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 4 years ago by Drops

Replying to larachan:

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.

Changed 4 years ago by Drops

missig diff file

comment:5 follow-up: Changed 4 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 4 years ago by rjollos

  • Description modified (diff)

comment:7 follow-up: Changed 4 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 4 years ago by jypark@…

Replying to jypark@inka.co.kr:

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 mean I still receive notification messages in plain text.
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 4 years ago by rlrj60

Replying to christophe@ravelsoft.com:

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 4 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 3 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 3 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 3 years ago by Drops

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

comment:14 Changed 3 years ago by jnankin@…

I had to add the following on line 420 of trac/notification.py:

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 3 years ago by jnankin@…

sorry, that should be:

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

comment:16 Changed 16 months ago by rjollos

  • Cc jun66j5 added
  • 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?

comment:17 Changed 16 months ago by jun66j5

Fine by me.

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.