Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I am trying to attach the following events but couldnt get it working.
Tried with ApplicationBase, ApplicationStartupHandler and IApplicationEventHandler but none of it worked.
Can anyone please provide the correct way for this in Umbraco 7.
Thanks in advance
You should be able to get it working with ApplicationEventHandler and the "Published" event from the contentService. This is working code in a v7 website we have:
public class DateFolderEvents : ApplicationEventHandler
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
Umbraco.Core.Services.ContentService.Published += ContentService_Published;
private void ContentService_Published(Core.Publishing.IPublishingStrategy sender, Core.Events.PublishEventArgs<Core.Models.IContent> e)
foreach (var content in e.PublishedEntities)
private void PublishDoc(IContent sender)
var user = new User(sender.CreatorId);
// do your stuff
For others working with Umbraco 8 you can see this link:
Thanks a lot Damiaan.. It worked like a charm :)
Don't forget to mark the reply as answer. It's not because we are friendly, we don't like karma ;-)
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted