public SrirachaEmailMessage CreateMessage(string subject, List<string> emailAddressList, object dataObject, string razorView) { if(string.IsNullOrEmpty(subject)) { throw new ArgumentNullException("subject"); } if(emailAddressList == null || emailAddressList.Count == 0) { throw new ArgumentNullException("emailAddressList"); } if(dataObject == null) { throw new ArgumentNullException("dataObject"); } if(string.IsNullOrEmpty(razorView)) { throw new ArgumentNullException("razorView"); } var email = new SrirachaEmailMessage { Id = Guid.NewGuid().ToString(), EmailAddressList = emailAddressList, Subject = subject, DataObject = dataObject, RazorView = razorView, QueueDateTimeUtc = DateTime.UtcNow, Status = EnumQueueStatus.New, CreatedByUserName = _userIdentity.UserName, CreatedDateTimeUtc = DateTime.UtcNow, UpdatedByUserName = _userIdentity.UserName, UpdatedDateTimeUtc = DateTime.UtcNow }; return _documentSession.StoreSaveEvict(email); }
public void MarkReceipientFailed(SrirachaEmailMessage emailMessage, string emailAddress, Exception err) { _emailQueueRepository.AddReceipientResult(emailMessage.Id, EnumQueueStatus.Error, emailAddress, err); }
public void MarkReceipientSucceeded(SrirachaEmailMessage emailMessage, string emailAddress) { _emailQueueRepository.AddReceipientResult(emailMessage.Id, EnumQueueStatus.Error, emailAddress); }
public void MarkFailed(SrirachaEmailMessage emailMessage) { _emailQueueRepository.UpdateMessageStatus(emailMessage.Id, EnumQueueStatus.Error); }
public void MarkSucceeded(SrirachaEmailMessage emailMessage) { _emailQueueRepository.UpdateMessageStatus(emailMessage.Id, EnumQueueStatus.Completed); }