SaaS CMS has officially launched! Learn more now.

Send Information Message back to user during PublishedContent event


When a user publishes a given Page Type, I am performing some business logic (creating a PDF file) How do I send an Information message back to the UI notifying the user that the PDF was genrated successfully.


private void EventsPublishedContent(object sender, ContentEventArgs e)

if (e.Content is MyPageType)

//Business Logic Here...

InformationMessage here <>< how do I send a message..


Apr 13, 2018 17:06

Using the IValidate interface you can code stuff and show as information to the user which might be a good option if the PDF creation is fast and stable:

To avoid users having to wait a lot when publishing if the PDF generation is slow it's probably better to run a job and alert the user by notification instead.

Apr 14, 2018 14:28

Update: By adding this to my project

public IEnumerable<ValidationError> Validate(MyTypeinstance)
return new[]
new ValidationError()
ErrorMessage = "A PDF for this page has been generated.",
PropertyName = "test",
Severity = ValidationErrorSeverity.Info,
ValidationType = ValidationErrorType.AttributeMatched

In the back office as soon as I change something I can see the notification message in the back office, but this is before the publish button is clicked. 

Is this the best you can do, in episerver?

Edited, Apr 16, 2018 16:41

You could consider hooking into the notifications framework. This would mean the message would appear as a new notification in the bell at the top right in the UI. The nice thing about this approach is that the PDF generation could happen async and the notification would appear as/when the PDF is ready.

More information here:

Apr 16, 2018 18:20
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.