Hello,
helps quite a lot but I am still missing some clue. I have this idea,
but I am not sure.
Your code implemets INotificationSubscriber and that's why its methods
are called any notification event is triggered. But it is not triggered
on any ticket change.
I wrote my single file plugin that implements ITicketChangeListener
interface and its method ticked_changed is always called on any ticket
change. The changes are caused by mailToTrack plugin.
https://trac-hacks.org/wiki/MailToTracPlugin
https://trac-hacks.org/browser/mailtotracplugin/0.12/plugin/mail2trac/email2ticket.py#L251
How to trigger notification event from my plugin or email2ticket.py
file? Is it the right way?
Thanks Michal
On 11/12/18 6:56 AM, Peter Suter wrote:
On 11.11.2018 22:35, Michal Seidl wrote:
Hello,
how to notify any verified user on any ticket changes by email in
version 1.2.3?
I have found smpt_always_cc in trac.ini but manually write, edit and
maintain list of all verified users?
I have also noticed at Preferences -> Notification site "Example: The
rule *"Never notify: I update a ticket"* should be above *"Notify: Any
ticket changes"* to get notifications of any ticket changes except
when you update a ticket." but there is no *Any ticket changes *in
drop down menu?
I have also look into mail.py file at *AlwaysEmailSubscriber* class
and it does not look to support any wild cards or special key word
like*all_users.*
Any sugestion?
Hello,
I suggest you read the following:
https://trac.edgewall.org/wiki/CookBook/Notification/Subscriptions
https://trac.edgewall.org/wiki/TracDev/PluginDevelopment/ExtensionPoints/trac.notification.api.INotificationSubscriber
It sounds like you want a very specific combination of three things:
1) All ticket notifications:
https://trac.edgewall.org/wiki/CookBook/Notification/Subscriptions#Subscribetoallticketnotifications
2) Default subscriptions:
https://trac.edgewall.org/wiki/CookBook/Notification/Subscriptions#Subscribeviacustomticketfield
3) All known users: self.env.get_known_users()
The combined plugin might possibly look something like this:
from trac.core import *
from trac.notification.api import INotificationSubscriber,
NotificationSystem
from trac.notification.model import Subscription
class AllKnownUsersAllTicketNotificationSubscriber(Component):
implements(INotificationSubscriber)
def matches(self, event):
if event.realm != 'ticket':
return
klass = self.__class__.__name__
for i in Subscription.find_by_class(self.env, klass):
yield i.subscription_tuple()
# Default subscription
for sid, name, addr in self.env.get_known_users():
for s in self.default_subscriptions():
yield s[0], s[1], sid, 1, addr, s[2], s[3], s[4]
def description(self):
return "Any ticket changes"
def default_subscriptions(self):
klass = self.__class__.__name__
return NotificationSystem(self.env).default_subscriptions(klass)
def requires_authentication(self):
return True
But you would have to test it yourself. Don't forget to configure it as
described in "4. A default subscription can be configured in the
TracIni#notification-subscriber-section:"
[notification-subscriber]
always_notify_all = AllKnownUsersAllTicketNotificationSubscriber
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.