ASPX templates
Version 4.x > ASPX templates > How to send the notification for custom events View modes: 
User avatar
Member
Member
scshrestha-veriskhealth - 11/12/2009 11:50:06 PM
   
How to send the notification for custom events
I want to use the notification provider feature for sending the notification messages for custom events. Currently notification modules send the messages for just three build-in events (document updated, document deleted, etc.). Could somebody provide any info for how to start or where to change the codes for getting the things done for custom events.

Any help or info will be highly appreciable.

User avatar
Kentico Consulting
Kentico Consulting
kentico_mirekr - 11/14/2009 6:03:31 AM
   
RE:How to send the notification for custom events
Hi,

Could you please try to explain us what exactly do you mean by custom event?

You can use following custom event handlers in Kentico CMS:

Data handler – responsible for insert/update/delete actions for all data items:
http://devnet.kentico.com/docs/devguide/data_handler.htm

Exception handler - this class processes all exceptions that occur in the web application:
http://devnet.kentico.com/docs/devguide/exception_handler.htm

Security handler - authentication and authorization:
http://devnet.kentico.com/docs/devguide/security_handler.htm

TreeNode handler - TreeNode insert/update/delete operations:
http://devnet.kentico.com/docs/devguide/treenode_handler.htm

Workflow handler - document approval/rejection/publishing/archiving operations:
http://devnet.kentico.com/docs/devguide/workflow_handler.htm

Best regards,
Miroslav Remias.

User avatar
Member
Member
scshrestha-veriskhealth - 11/16/2009 9:54:15 PM
   
RE:How to send the notification for custom events
Thanx a lot Miroslav for your info on custom event handlers.

By saying i want to send the notification message for custom events, i mean that i want to manually configure the subscription configuration for notification message for some other events (other than document updated, document deleted, etc.) and want to send the notification whenever these event occurs. In other words i want the details about using the notification provider feature manually.

Also, i want to know that in which table these notification messages are stored because i can't find the appropriate table where the sent notification messages are saved.


Best Regards,
Sabin C Shrestha

User avatar
Kentico Consulting
Kentico Consulting
kentico_mirekr - 12/1/2009 1:49:47 PM
   
RE:How to send the notification for custom events
Hi,

In your custom event you need to call following method, which raises notification events according to the specified parameters:

CMS.SettingsProvider.ModuleCommands.NotificationsRaiseEvent(String, String, Int32, String, String, Int32, String, Object, array<String,2>[,](,))  

public static void NotificationsRaiseEvent(
string eventSource,
string eventCode,
int eventObjectId,
string eventData1,
string eventData2,
int siteId,
string where,
Object resolverData,
string[,] resolverSpecialMacros
)

Parameters
eventSource (String)
Subscription event source
eventCode (String)
Subscription event code
eventObjectId (Int32)
Subscription event object ID
eventData1 (String)
Subscription event data 1
eventData2 (String)
Subscription event data 2
siteId (Int32)
ID of the site where the event belongs
where (String)
Additional WHERE conditoin
resolverData (Object)
Custom data for macro resolver (DataRow or DataClass object)
resolverSpecialMacros (array<String,2>[,](,))
Special macros (couples [name, value])


Then you need to use “Notification subscription” web part and create custom notification gateway for this purpose according to following documentation:

http://devnet.kentico.com/docs/devguide/custom_notification_gateway_overview.htm

Tables you are looking for in database are Notification_Subscription, Notification_Template, Notification_TemplateText and Notification_Gateway.

I hope this will help you.

Best Regards,
Miroslav Remias.