Esempio n. 1
0
 private IndividualMail CreateAssignmentUpdateNotificationDeleted(User user, string deletedList)
 {
     var template = _mailConfiguration.AssignmentUpdateDeleteNotificationTemplate;
     return new IndividualMail
     {
         From = _mailConfiguration.SendMailNotificationsFrom,
         To = user.Email,
         Subject = template.Subject,
         IsHtml = template.IsHtml,
         Body = string.Format(template.BodyTemplate, user.FirstName, user.LastName, deletedList),
     };
 }
Esempio n. 2
0
 public IndividualMail CreateAssignedCaseWorkerNotification(User caseWorker, int caseId)
 {
     var template = _mailConfiguration.CaseWorkerAssignedNotificationTemplate;
     return new IndividualMail
     {
         From = _mailConfiguration.SendMailNotificationsFrom,
         To = caseWorker.Email,
         Subject = template.Subject,
         IsHtml = template.IsHtml,
         Body = string.Format(template.BodyTemplate, caseWorker.FirstName, caseWorker.LastName, caseId),
     };
 }
Esempio n. 3
0
        public IndividualMail CreateAssignmentUpdateNotification(User user, int[] deleted, int[] created)
        {
            var deletedList = string.Join(", ", deleted);
            var createdList = string.Join(", ", created);

            if (deleted.Length == 0)
                return CreateAssignmentUpdateNotificationCreated(user, createdList);

            if (created.Length == 0)
                return CreateAssignmentUpdateNotificationDeleted(user, deletedList);

            return CreateAssignmentUpdateNotificationBoth(user, deletedList, createdList);
        }
Esempio n. 4
0
 public IndividualMail CreateResetSecurePhraseCompleteNotification(User user)
 {
     return CreateResetCompleteNotification(user, () => _mailConfiguration.ResetSecurePhraseCompleteNotificationTemplate);
 }
Esempio n. 5
0
 public IndividualMail CreateCommentNotification(User caseWorker, User commenter, int caseId, string comment)
 {
     // TODO: implement
     return new IndividualMail
     {
         From = _mailConfiguration.SendMailNotificationsFrom,
         To = caseWorker.Email,
         Subject = "Case Commented",
         Body = string.Format("Case {0} has been commented by {1}: {2}",
             caseId, commenter.FirstName + " " + commenter.LastName, comment),
         IsHtml = false,
     };
 }
Esempio n. 6
0
 private IndividualMail CreateResetCompleteNotification(User user, Func<MailTemplate> getTemplate)
 {
     var template = getTemplate();
     return new IndividualMail
     {
         From = _mailConfiguration.SendMailNotificationsFrom,
         To = user.Email,
         Subject = template.Subject,
         Body = template.ApplyTemplate(user.UserId, user.Email, user.FirstName, user.LastName),
         IsHtml = template.IsHtml,
     };
 }