Modify

Opened 7 years ago

Last modified 7 years ago

#12518 new task

Implement new notification API

Reported by: Franz Owned by: Franz
Priority: low Component: MailPlugin
Severity: normal Keywords: API
Cc: Trac Release: 1.0

Description

With version 1.1.3 Trac changed his notification API (see Advanced Notification enhancements).

This new API should also be used in MailPlugin.

The ticket is not critical, since MailPlugin also works fine with 1.1.x (tested with 1.1.6)

Attachments (3)

XMailEMailModule.py_PARTLY.diff (21.9 KB) - added by Franz 7 years ago.
Patch for partly implemented API
XMailEMailModule.py_API (24.5 KB) - added by Franz 7 years ago.
Patch with new notification API, but not working
XMailEMailModule.py_API.diff (24.5 KB) - added by Franz 7 years ago.
Patch with new notification API, but not working

Download all attachments as: .zip

Change History (4)

Changed 7 years ago by Franz

Patch for partly implemented API

Changed 7 years ago by Franz

Attachment: XMailEMailModule.py_API added

Patch with new notification API, but not working

comment:1 Changed 7 years ago by Franz

Patch XMailEMailModule.py_PARTLY.diff is partly working (sends mail, but without subject and encoding is wrong), but it is probably not using the recommended way of the new API (see also module API of Package notification).

Patch XMailEMailModule.py_API.diff uses probably more of the recommended way, but apparently incorrect, since Trac throws Exception too many values to unpack; stacktrace is:

File "build\bdist.win32\egg\xmail\XMailEMailModule.py", line 522, in run
    self.func()
File "build\bdist.win32\egg\xmail\XMailEMailModule.py", line 161, in _sendAllMails
    notifyer.send_mails(username, notify_data)
File "build\bdist.win32\egg\xmail\XMailEMailModule.py", line 415, in send_mails
    datetime.now(utc), author))
File "build\bdist.win32\egg\trac\notification\api.py", line 358, in notify
    self.distribute_event(event, self.subscriptions(event))
File "build\bdist.win32\egg\trac\notification\api.py", line 369, in distribute_event
    for sid, authenticated, address, transport, format in subscriptions:
too many values to unpack

Changed 7 years ago by Franz

Patch with new notification API, but not working

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain Franz.

Add Comment


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

 
Note: See TracTickets for help on using tickets.