예제 #1
0
        public DcReplicasResponse GetSentDcReplicaIds(Guid bulkEmailId)
        {
            var bulkEmailTemplateRepository = new BulkEmailTemplateRepository(UserConnection);

            return(new DcReplicasResponse {
                Replicas = bulkEmailTemplateRepository.GetSentDcReplicaIds(bulkEmailId).Select(id => new Replica {
                    Id = id
                }).ToArray()
            });
        }
예제 #2
0
        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()
            });
        }
예제 #3
0
        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
            });
        }
예제 #4
0
 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;
     }
 }