New page published - getting event or some sort of trigger
Vote:
Hi,
I have a small issue which I dont know how to go about.
For a news section we have I would like to make a subscribe section. The subscribers I already have in a database table and so I want an event when a page is published.
Once I get my function triggered I can work out the sending of email and to make some sort of dynamic variable that one can clear when the page is published for the first time (so it doesnt get resent to the subscribers). Which shouldnt be that hard.
ps.
I have tried reading up on the subscribe function in Epi but there seems to be some issues with Anonymous users and I cant really seem to understand how to use it.
.ds
Hi.
There are several events that fires when pages are published. Check the SDK for more information, especially under the class DataFactory. Here you'll find events like:
- CreatingPage
- PublishingPage
- PublishedPage
- SavingPage
...and many more
To get these to work, you have to trigger them in global.asax. Check the SavingPage event in the SDK for an example.
You can use the PageData.Changed property to check if the page has been set to be sent via email. This is the same functionality that the EPiServer subscription does. It sends out all new published pages, and also existing pages that has been republished AND checked for Changed.
Hope this helps you.
Frank :)
What happens when i click publish on a page but have set the start publish date to some other date?
It shouldn't fire on click if the date is set in the future, right?
And also the event should be fired when the date is reached and the page i publicly available?
Is this the way it works?