I am using Umbraco 4.6.2 and you need to extend the default notifications that it provides. For the sake of this question, let's say I'm trying to add a "Unpublish" message.
In \umbraco\presentation\umbraco\dialogs\notifications.aspx.csit creates a list of checkbx elements that are displayed to the user when the "Notifications" dialog is opened from the context menu.
I see that everyone Actionhas the ShowInNotifier property - how can I set this value to truefor the UnPublish action? Is it necessary to modify the basic codebase, or is there a good way that I can gracefully extend Umbraco?
So, after I added this, users can sign up for the UnPublish notification (I don’t see any steps here?). Will it automatically send notifications now?
I suppose not, so the next thing I did is to hook up the UnPublish event:
public class CustomEvents : ApplicationBase
{
public CustomEvents()
{
Document.AfterUnPublish += new Document.UnPublishEventHandler(Document_AfterUnPublish);
}
void Document_AfterUnPublish(Document sender, umbraco.cms.businesslogic.UnPublishEventArgs e)
{
var user = User.GetCurrent();
if (!string.IsNullOrEmpty(user.Email) && user.GetNotifications(sender.Path).Contains("UnPublish"))
{
string umbracoNotificationSenderAddress = "";
string subject = "Notification of UnPublish performed on " + MyUtilities.GetFriendlyName(sender.Id);
string message = MyUtilities.GetFriendlyName(sender.Id) + " has just been unpublished.";
umbraco.library.SendMail(umbracoNotificationSenderAddress, user.Email, subject, message, true);
}
}
}
So, bits of this code that are not real / I need some pointers to:
If this is not possible, and I must create my own email address:
( ) : >