public DcReplicasResponse GetSentDcReplicaIds(Guid bulkEmailId) { var bulkEmailTemplateRepository = new BulkEmailTemplateRepository(UserConnection); return(new DcReplicasResponse { Replicas = bulkEmailTemplateRepository.GetSentDcReplicaIds(bulkEmailId).Select(id => new Replica { Id = id }).ToArray() }); }
public DcReplicasResponse GetDcReplicasRecipientCount(Guid[] replicaIds) { var bulkEmailTemplateRepository = new BulkEmailTemplateRepository(UserConnection); return(new DcReplicasResponse { Replicas = bulkEmailTemplateRepository.GetBulkEmailRecipientReplicaCount(replicaIds) .Select(x => new Replica { Id = x.Key, RecipientCount = x.Value }).ToArray() }); }
public DcReplicasResponse GetDcReplicas(Guid bulkEmailId) { var bulkEmailTemplateRepository = new BulkEmailTemplateRepository(UserConnection); var dcReplicaModels = bulkEmailTemplateRepository.GetDcReplicas(bulkEmailId); var replicas = dcReplicaModels.Select(sr => new Replica { Name = sr.Caption, Mask = sr.Mask, Id = sr.Id }).ToArray(); return(new DcReplicasResponse { Replicas = replicas }); }
public GetBulkEmailHeadersResponse GetBulkEmailReplicaHeaders(GetBulkEmailHeadersRequest request) { try { var repository = new BulkEmailTemplateRepository(UserConnection); var response = new GetBulkEmailHeadersResponse(); response.Headers = repository.GetHeaders(request.BulkEmailId) .Select(x => (ReplicaHeaders)x) .ToArray(); var defaultHeaders = repository.GetDefaultHeaders(request.BulkEmailId); response.DefaultHeaders = defaultHeaders; return(response); } catch (Exception e) { MailingUtilities.Log.ErrorFormat( "[BulkEmailTemplateService.GetBulkEmailReplicaHeaders]: Error while reading replica headers", e); throw; } }