Exporting event data on publish
Hi,
I'm not sure how to achieve what I'm trying to, but I'm attempting to get Sitefinity to send data to an external CRM whenever an event is created (the data will be exported, we think, as a JSON array). The export should happen as a default action as part of the publication process. My question is if this is possible using the Event API or if a custom event module would be the better approach?
Cheers,
Phil.
Hello Phil,
You can hook up to the EventsManager events in Global.asax as well, please see the below example for PageManager, the implementation should be identical:
protected
void
Application_Start(
object
sender, EventArgs e)
PageManager.Executing +=
new
EventHandler<Telerik.Sitefinity.Data.ExecutingEventArgs>(PageManager_Executing);
PageManager.Executed +=
new
EventHandler<Telerik.Sitefinity.Data.ExecutedEventArgs>(PageManager_Executed);
private
void
PageManager_Executing(
object
sender, Telerik.Sitefinity.Data.ExecutingEventArgs e)
var cn = e.CommandName;
var ca = e.CommandArguments;
private
void
PageManager_Executed(
object
sender, Telerik.Sitefinity.Data.ExecutedEventArgs e)
var cn = e.CommandName;
var ca = e.CommandArguments;
as per your sugestion if the event executed many times ("CreateEvent" in events list)
"alternatively you can create a custom provider for pages inheriting form the default one - Telerik.Sitefinity.Modules.Pages.Data.OpenAccessEventProvider and override its methods like CreatePageNode, MovePageNode etc. "
Is there another way to send an email when new event created (without implementing OpenAccessEventProvider) ?
Thanks,
Romany
Hello,
Override the data provider and the methods you need which is several rows of code because you are only going to send an email and not changing the base logic
Kind regards,
Ivan Dimitrov
the Telerik team