On Wednesday, January 11, 2017 at 6:08:02 AM UTC-8, Roger Oberholtzer wrote:TIA.Is there a good description of these parameters for Trac 1.2? They have gone missing from my .ini files as I was using the Announcer plugin.I had been using the Announcer plugin in Trac. With a recent update to Trac 1.2, the Announcer plugin is no longer supported. The suggestion is to re-enable the Trac notifier.
--Roger OberholtzerThe notifications components will be enabled if you don't explicitly disable them or a parent. Otherwise, it would be:trac.notification.* = enabledtrac.ticket.notification.* = enabled
How about https://trac.edgewall.org/wiki/TracNotification ?
--
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
trac-users+...@googlegroups.com.
To post to this group, send email to
trac-...@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.
How about https://trac.edgewall.org/wiki/TracNotification ?
I had been using the Announcer plugin in Trac. With a recent update to Trac 1.2, the Announcer plugin is no longer supported. The suggestion is to re-enable the Trac notifier.
The section [notification-subscriber] does it still exist?
[notification-subscriber] always_notify_cc = CarbonCopySubscriber always_notify_previous_updater = TicketPreviousUpdatersSubscriber always_notify_updater = TicketUpdaterSubscriber (If you upgraded an older Trac environment, it depends what [notification] options where configured at the time.)
Documentation is unclear on https://trac.edgewall.org/wiki/TracNotification , the details hyperlink points to itself.
How can I configure all those available subscribers like TicketOwnerSubscriber?
How can the administrator define the default rules, as currently I see only one default rule in the preferences:
Notify: Ticket that I'm listed in the CC field is modified
You can add more default rules by adding them to [notification-subscriber]. [notification-subscriber] always_notify_owner = TicketOwnerSubscriber Best regards, Peter
On 12.01.2017 16:05, Mo wrote:
Yes. By default (after trac-admin initenv) it looks like this:
The section [notification-subscriber] does it still exist?
[notification-subscriber] always_notify_cc = CarbonCopySubscriber always_notify_previous_updater = TicketPreviousUpdatersSubscriber always_notify_updater = TicketUpdaterSubscriber (If you upgraded an older Trac environment, it depends what [notification] options where configured at the time.)
Yes. By default (after trac-admin initenv) it looks like this:
[notification-subscriber] always_notify_cc = CarbonCopySubscriber always_notify_previous_updater = TicketPreviousUpdatersSubscriber always_notify_updater = TicketUpdaterSubscriber
You can add more default rules by adding them to [notification-subscriber]. [notification-subscriber] always_notify_owner = TicketOwnerSubscriber
[notification-subscriber]
always_notify_owner = TicketOwnerSubscriber
always_notify_cc = CarbonCopySubscriber
always_notify_previous_updater = TicketPreviousUpdatersSubscriber
always_notify_updater = TicketUpdaterSubscriber
Which options are possible here?
Currenty I have
[notification-subscriber]
always_notify_owner = TicketOwnerSubscriber
always_notify_cc = CarbonCopySubscriber
always_notify_previous_updater = TicketPreviousUpdatersSubscriber
always_notify_updater = TicketUpdaterSubscriber
As this is not documented I need to ask some things.
Why isn't that defined like default_subscriptions=TicketOwnerSubscriber,CarbonCopySubscriber,TicketPreviousUpdatersSubscriber,TicketUpdaterSubscriber ?
What if I mix up those variables?
class TesterCustomFieldSubscriber(Component):
"""Subscriber for custom ticket field."""
implements(INotificationSubscriber)
field_name = 'tester'
def matches(self, event):
if event.realm != 'ticket':
return
if event.category not in ('created', 'changed', 'attachment added',
'attachment deleted'):
return
# Custom field with comma-separated string. Parse to set.
chrome = Chrome(self.env)
to_set = lambda field: set(chrome.cc_list(field))
field_set = to_set(event.target[self.field_name] or '')
# Harvest previous field values
if 'fields' in event.changes and self.field_name in event.changes['fields']:
field_set.update(to_set(event.changes['fields'][self.field_name]['old']))
matcher = RecipientMatcher(self.env)
klass = self.__class__.__name__
sids = set()
for field in field_set:
recipient = matcher.match_recipient(field)
if not recipient:
continue
sid, auth, addr = recipient
# Skip if this is my own change:
if sid == event.author:
continue
# Default subscription
for s in self.default_subscriptions():
yield s[0], s[1], sid, auth, addr, s[2], s[3], s[4]
if sid:
sids.add((sid, auth))
for s in Subscription.find_by_sids_and_class(self.env, sids, klass):
yield s.subscription_tuple()
def description(self):
ticket_system = TicketSystem(self.env)
ticket_field_labels = ticket_system.get_ticket_field_labels()
field_label = ticket_field_labels[self.field_name]
return "Ticket that I'm listed in as %s is modified by someone else. [AZ]" % field_label
def default_subscriptions(self):
klass = self.__class__.__name__
return NotificationSystem(self.env).default_subscriptions(klass)
def requires_authentication(self):
return True
Additionally I skip notifications if the change was done by myself. For all existing Subscribers in Trac I created alternative copies doing the same while dropping my own changes.
no notification for any other changes on the ticket.
if 'fields' in event.changes and not all(self.field_name == key for key in event.changes['fields']):
return
On 19.01.2017 14:38, Mo wrote:
Why don't you simply add a rule "Never notify: I update a ticket"?Additionally I skip notifications if the change was done by myself. For all existing Subscribers in Trac I created alternative copies doing the same while dropping my own changes.
never_notify_updater = TicketUpdaterSubscriber
never_notify_updater.adverb = never
Does this work?no notification for any other changes on the ticket.
if 'fields' in event.changes and not all(self.field_name == key for key in event.changes['fields']):
return
Am Donnerstag, 19. Januar 2017 19:24:52 UTC+1 schrieb Peter Suter:On 19.01.2017 14:38, Mo wrote:
Why don't you simply add a rule "Never notify: I update a ticket"?Additionally I skip notifications if the change was done by myself. For all existing Subscribers in Trac I created alternative copies doing the same while dropping my own changes.
Peter, can I make that system-default by adding
never_notify_updater = TicketUpdaterSubscriber
never_notify_updater.adverb = never
Yes, that's correct.
Best regards,
Peter
Am Donnerstag, 19. Januar 2017 19:24:52 UTC+1 schrieb Peter Suter:Does this work?no notification for any other changes on the ticket.
if 'fields' in event.changes and not all(self.field_name == key for key in event.changes['fields']):
return
What does that do exactly?
I like to get notifications if my name is listed in field 'developer' AND any of the fields 'developer' OR 'developer-status' has changed.
if 'fields' in
event.changes and
not all(key in ['developer', 'developer-status']
for key in event.changes['fields']):
return
Best regards,
Peter
[components]
trachtmlnotification. * = enabled
Then I went into Preferences -> Notifications and changed to "text/html" and saved, without errors. However, when I come back in the same "notifications", text/plain is still there.And it does not send emails in html format.
I managed to save(text/html). However, it still does not send in html format.
I put it in [notification]. After this came the error:
2017-02-23 17:48:43,067 Trac[mail] DEBUG: EmailDistributor has found the following formats capable of handling 'email' of 'ticket': text/html, tex
t/plain
2017-02-23 17:48:43,068 Trac[web_ui] ERROR: Failure sending notification on change to ticket #14377: ConfigurationError: Cannot find implementatio
n(s) of the <code>IEmailAddressResolver</code> interface named <code>DefaultDomainEmailResolver</code>, <code>SpecifiedEmailResolver</code>. Pleas
e check that the Component is enabled or update the option <code>[notification] email_address_resolvers</code> in trac.ini.
Here it is:
[notification]
email_address_resolvers = SpecifiedEmailResolver,SessionEmailResolver,DefaultDomainEmailResolver
On 23.02.2017 19:41, ivanelson wrote:
> The documentation is not clear.
>
> I am currently like this:
>
> [notification]
> ...
> default_format =text/html
This option does not exist. You can delete this line.
https://trac.edgewall.org/wiki/TracIni#notification-section