Share » Forums » Developer » Customise notifications

Customise notifications

Customise notifications

Wednesday 15 June 2005 7:06:55 am - 6 replies

Author Message

Paul Borgermans

Wednesday 15 June 2005 10:56:14 am

Dries,

Please file this as a suggestion or enhancement in the bug tracker as this is not possible now without tweaking the notification system.

It was also discussed a bit during the summer camp

Regards

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Dries Samyn

Thursday 16 June 2005 2:44:13 am

Thanks Paul.
I have now added it as a suggestion.

Is there anybody who could point me to where to tweak the notification system so to implement this?

Regards,

Dries.

Paul Borgermans

Thursday 16 June 2005 3:17:35 am

I think I found it (at least it works like you want here on a live ezp 3.4.6 site):

in file kernel/classes/notification/handler/ezsubtree/ezsubtreehandler.php

around line 122 uncomment the part that checks for an updated version.

So change

...

if (  //$versionObject->attribute( 'version' ) != 1 ||
             $versionObject->attribute( 'version' ) != $contentObject->attribute( 'current_version' ) )
        {
            return EZ_NOTIFICATIONEVENTHANDLER_EVENT_SKIPPED;
        }

....

to

...

if (  $versionObject->attribute( 'version' ) != 1 ||
             $versionObject->attribute( 'version' ) != $contentObject->attribute( 'current_version' ) )
        {
            return EZ_NOTIFICATIONEVENTHANDLER_EVENT_SKIPPED;
        }

....

hth

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Paul Borgermans

Thursday 16 June 2005 3:22:34 am

By consequence, it is easy to change the behaviour according to some scenarios:

- allow the user to have an option to receive updates as well
- turn it on/off globally for notifying updates
- turn notifications off temporarily globally, for a certain node/object or a subtree

What do you think?

Anyone volunteering or should I do it?

Regards

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Dries Samyn

Thursday 16 June 2005 5:21:40 am

Thanks for the pointers Paul.
I've managed to do what I wanted to do by implementing the code you gave, and also by changing:

if ( !$contentClass )
            return EZ_NOTIFICATIONEVENTHANDLER_EVENT_SKIPPED;

with

if ( !$contentClass ||
        	$contentClass->attribute( 'name' )!="News Article" )
        {
            return EZ_NOTIFICATIONEVENTHANDLER_EVENT_SKIPPED;
        }

where obviously "News Article" is the name of the content class of the content that I want to be queued for notifications.
This works fine. It'd be great, as a suggestion, if in a future release these things could be configured in the notification ini file.

Thanks again for the help.

Dries.

Andy Caiger

Wednesday 29 June 2011 10:59:12 pm

Six years later, is it possible to do this with eZ Publish out of the box, or do we still have to modify the kernel PHP? Filtering notifications on class or on new objects versus existing objects (as we can do using the publish workflow) seems a very useful thing to be able to do. Is it possible now?

EAB - Integrated Internet Success
Offices in England, France & China.
http://www.eab.co.uk http://www.eab-china.com http://www.eab-france.com

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu