private void InitCommonAttributes(ERItemNotifications item) { To = String.Join(",", item.ToMails); Cc = String.Join(",", item.ERConf.cc); Bcc = String.Join(",", item.ERConf.bcc); Item = item; ItemUrlBlock = String.Format(TemplatesParams["MAIL_URL_TEMPLATE"], item.listItem.GetItemFullUrl(), item.itemTitle); EditorDisplayName = item.eventProperties.UserDisplayName; ModifiedByBlock = String.Format(ModifiedByBlockTemplate, EditorDisplayName); }
public static void SendNotifications(ERItemNotifications itemER) { List <NotificationEventArgs> notificationEventArgs = itemER.EventArgs; NotificationsManager notificationsManager = new NotificationsManager(); MailNotification mailNotification = new MailNotification(notificationsManager); notificationsManager.OnNewEvent(notificationEventArgs); mailNotification.Unregister(notificationsManager); }
public NotificationEventArgs( ERItemNotifications item, string mailSubjectMode, string modifiedByBlockTemplate, Dictionary <string, string> templatesParams ) { ModifiedByBlockTemplate = modifiedByBlockTemplate; AttachmentUrl = item.listItem.Web.Url + "/" + item.eventProperties.AfterUrl.ToString(); TemplatesParams = templatesParams; InitCommonAttributes(item); Body = CreateBody(); Subject = String.Format("{0}: {1}", item.itemTitle, mailSubjectMode); }
public NotificationEventArgs( ERItemNotifications item, List <SPItemField> fieldsToTrack, string mailSubjectMode, string modifiedByBlockTemplate, Dictionary <string, string> templatesParams, bool showBeforeValuesParam = true ) { ShowBeforeValues = showBeforeValuesParam; ModifiedByBlockTemplate = modifiedByBlockTemplate; TemplatesParams = templatesParams; InitCommonAttributes(item); Body = CreateBody(fieldsToTrack); Subject = String.Format("{0}: {1}", item.itemTitle, mailSubjectMode); }