private void createReceiveNotification(M_Message message, T_Task task) { if (message.Notified == false) { helper = new MailBodyHelper(); string content = helper.getReceiveStateBody(message, task, baseURL, templatepath); List <string> recipients = new List <string>(); if (String.IsNullOrEmpty(instance.Owner)) { var subject = processStore.getProcessSubjectForWFId(task.WFId); userStore = StoreHandler.getUserStore(cfgSQLConnectionString); recipients.AddRange(userStore.getUsernamesForRole(subject.U_Role_Id)); } else { recipients.Add(instance.Owner); } foreach (string user in recipients) { mail.sendMail(user, "InFlow: " + task.Name + " #" + task.Id + "|" + message.Id, content); } messageStore.markMessageAsNotified(message.Id); } }
public void createNotificationForTask(int TaskId, string cfgSQLConnectionString) { this.cfgSQLConnectionString = cfgSQLConnectionString; configStore = StoreHandler.getConfigStore(cfgSQLConnectionString); baseURL = configStore.getString(BaseURL); templatepath = configStore.getString(Email_NotificationTemplate); taskStore = StoreHandler.getTaskStore(cfgSQLConnectionString); T_Task task = taskStore.getTaskById(TaskId); helper = new MailBodyHelper(); processStore = StoreHandler.getProcessStore(cfgSQLConnectionString); instance = processStore.getWorkflowInstance(task.WFId); mail = new SmtpUtils(configStore); if (task.Type.Equals("F") || task.Type.Equals("S")) { if (configStore.getBool(Email_Notifications_Tasks)) { string content = helper.getStateBody(task, baseURL, templatepath); List <string> recipients = new List <string>(); if (String.IsNullOrEmpty(instance.Owner)) { var subject = processStore.getProcessSubjectForWFId(task.WFId); userStore = StoreHandler.getUserStore(cfgSQLConnectionString); recipients.AddRange(userStore.getUsernamesForRole(subject.U_Role_Id)); } else { recipients.Add(instance.Owner); } foreach (string user in recipients) { mail.sendMail(user, "InFlow: " + task.Name + " #" + task.Id, content); } } } if (task.Type.Equals("R")) { if (configStore.getBool(Email_Notifications_Messages)) { messageStore = StoreHandler.getMessageStore(cfgSQLConnectionString); var messages = messageStore.getMessagesForReceiveStateTask(task.WFId, task.getTaskPropertiesAsListOfString()); foreach (var i in messages) { createReceiveNotification(i, task); } } } }
public void createNotificationForTask(int TaskId, string cfgSQLConnectionString) { this.cfgSQLConnectionString = cfgSQLConnectionString; configStore = StoreHandler.getConfigStore(cfgSQLConnectionString); baseURL = configStore.getString(BaseURL); templatepath = configStore.getString(Email_NotificationTemplate); taskStore = StoreHandler.getTaskStore(cfgSQLConnectionString); T_Task task = taskStore.getTaskById(TaskId); helper = new MailBodyHelper(); processStore = StoreHandler.getProcessStore(cfgSQLConnectionString); instance = processStore.getWorkflowInstance(task.WFId); mail = new SmtpUtils(configStore); if (task.Type.Equals("F") || task.Type.Equals("S")) { if (configStore.getBool(Email_Notifications_Tasks)) { string content = helper.getStateBody(task, baseURL, templatepath); List<string> recipients = new List<string>(); if (String.IsNullOrEmpty(instance.Owner)) { var subject = processStore.getProcessSubjectForWFId(task.WFId); userStore = StoreHandler.getUserStore(cfgSQLConnectionString); recipients.AddRange(userStore.getUsernamesForRole(subject.U_Role_Id)); } else { recipients.Add(instance.Owner); } foreach (string user in recipients) { mail.sendMail(user, "InFlow: " + task.Name + " #" + task.Id, content); } } } if (task.Type.Equals("R")) { if (configStore.getBool(Email_Notifications_Messages)) { messageStore = StoreHandler.getMessageStore(cfgSQLConnectionString); var messages = messageStore.getMessagesForReceiveStateTask(task.WFId, task.getTaskPropertiesAsListOfString()); foreach (var i in messages) { createReceiveNotification(i, task); } } } }