+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Exporting event data on publish

Exporting event data on publish

4 posts, 0 answered
  1. Phil
    Phil avatar
    4 posts
    Registered:
    05 Dec 2011
    19 Mar 2012
    Link to this post
    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.
  2. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    Registered:
    06 Dec 2016
    21 Mar 2012
    Link to this post
    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;
          
    }
    However please note that some of the events might be executing more than once.
    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.

    There is a configuration section Sitefinity/Administration/Settings/Advanced >> Pages >> Providers that will allow you to register your custom OA provider or replace the type of the default one which is shown as a node of Providers.

    All the best,
    Boyan Barnev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Romany
    Romany avatar
    8 posts
    Registered:
    19 Mar 2012
    25 Mar 2012
    Link to this post
    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
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    26 Mar 2012
    Link to this post
    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
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
4 posts, 0 answered