Re: Horde Notification

Michael J Rubinsky <[email protected]> Mon, 02 Jan 2017 15:56:31 +0000
Newsgroups gmane.comp.horde.devel
Message-ID <20170102155631.Horde.63GdDRA2KVJ5YYDI9VRw53c@h4.theupstairsroom.com>
Quoting Sebastian Birnbach <[email protected]>:

> I came across the Horde_Notification lib as a means to display user
> messages. The library seems to go way beyond this but I could not find
> example code or a writeup on the notification mechanism.
>
> questions:
> * what listeners are there in a standard Horde installation?

Look in Horde/Notification/Listener and Core/Notification/Listener

> * what are the supported status levels? horde.error, horde.warning,
> horde.message - anything else?

horde.alarm, horde.success.

These are defined in Horde_Core_Notification_Event_Status::

> * how can notifications be used for logging?

horde.error messages are already logged. If you want to add additional  
logging, look at Horde_Core_Notification_Handler_Decorator_Hordelog::  
to see how this is done. Also, look at  
Horde_Core_Factory_Notification:: to see how everything is registered.

> * can notifications be used for sending emails? The API docs speak of this
> possibility but I am not sure how to do it - and why to prefer it over
> using the mail application API directly.

Depending on what you are trying to do, you would either implement  
another Listener or Decorator to send the desired status message.  
Also, if by "mail application" you mean IMP, then it doesn't have any  
external API to send a message. You would use Horde_Mail or  
Horde_Mime_Mail to send the message.

As for why use Horde_Notification to do this, you would do this if it  
suits your needs to send an email when a certain type of notification  
is raised.

>
> Thanks and a good new year to everybody!
>
>   Sebastian
> --
> dev mailing list
> Frequently Asked Questions: http://wiki.horde.org/FAQ
> To unsubscribe, mail: [email protected]



-- 
mike
The Horde Project
http://www.horde.org
https://www.facebook.com/hordeproject
https://www.twitter.com/hordeproject

-- 
dev mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
To unsubscribe, mail: [email protected]
smime.p7s (application/pkcs7-signature, 3.2 KB) - not displayed