Hi,

It appears that OTRS has 3 different mail notification systems which interact poorly with each other. I want to patch it, but don't know which way is better, for patch to be later accepted by upstream.

Our company uses OTRS 3.0.10 (upgrade to 3.1.x scheduled in a month, but problem, as I can see, persists there, too). There are 3 different mail notification systems in OTRS:

1) customer auto-replies
2) Notification (e.g. ru::Agent::AddNote)
3) NotificationEvent

We need the following behaviour: when one agent replies something to customer in a ticket via Web-interface - that is, 'SendAnswer' via 'AgentTicketCompose' page - then all agents subscribed to this queue must receive mail notification with that text. This is achieved through setting notification (one for each queue, we have more than a dozen) on event 'ArticleSend' with OTRS_AGENT_BODY to that queue supervisor role.

This week, we needed to enable (previously disabled) customer auto-replies on the new ticket creation. Customer now happily gets their reply, but all agents on that queue now receive a letter consisting of a single '-' (actually, two identical messages, but that appears to be fixed in bug#7407 according to changelog - though one garbage msg will still be produced).

As I dig through all that undocumented stuff, it appears that 'ArticleSend' triggers on every message sent, those sent as customer auto-replies, too.

Now, it is the question, how we could achieve our goal by "the right way" ? E.g. a patch which is "architecturally right" and could be submitted to upstream.

The problem is that we don't know exactly what events are available: they are neither described on AdminNotificationEvent page nor that list is complete - there are calls to EventHandlet in code which are not listed on this page (e.g. ArticleCustomerNotification, may be more). The other notification system, the plain AdminNotification page - also don't describe what exactly those notifications are. I had to dig to code to find out when Agent::AddNote fires precisely). Even than, comments in code say that customer notifications are obsoleted, I don't know, are plain AdminNotification ones, too?..

I see two possible ways to solve our problem:

1. Register new event SendAnswer, add to AgentTicketCompose page and to list of events.

This is probably the right way.

2. Make new "plain" agent notification e.g. ru::Agent::SendAnswer and process it in Kernel/System/Ticket/Article.pm along with others, like AddNote and FollowUp.

This way looks promising in the sense that agent could disable some of the notifications. I've found an undocumented feature added in rev. 1.85 at April 2005, here:

        if (
            $UserData{UserSendFollowUpNotification}
            && $UserData{UserSendFollowUpNotification} == 2
            && ...

So i went to ''Ticket -> Frontend::Agent::Preferences'' and added under ''PreferencesGroups###FollowUpNotify'' a new value under ''Data'', to be 0/1/2==None/Mine/All instead of 0/1==No/Yes. This is for FollowUp only, as I discovered a little later, but the same setting could be used for possible future 'SendAnswer' notification.


There easily may be third way, as I don't understand entire system, because developer book lacks very many info and thus don't help much.

Please help.


--
Vadim Goncharov     <[email protected]>           RU-Center
NET Department                            http://www.nic.ru
NET-SYS Group             phone:+7(495)737-7646  (ext.4019)
_______________________________________________
OTRS mailing list: dev - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/dev
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/dev

Reply via email to