protected Error SendMessage(CompanyModel company, UserModel sender, MessageTemplateType templateId, TaskType notificationType, List <UserModel> recipients, Dictionary <string, string> dict, List <string> attachments = null) { // Send as email var message = new EMailMessage(sender, templateId); message.AddRecipients(recipients); message.AddProperties(dict); message.AddAttachments(attachments); EMailService.EMailService es = new EMailService.EMailService(_db, company); var error = es.SendEMail(message); //if (!error.IsError) { // Now send as a notification // TaskManagerService.TaskManagerService ts = new TaskManagerService.TaskManagerService(_db, company); // error = ts.SendTask(templateId, notificationType, recipients, dict); //} return(error); }