コード例 #1
0
 private SendCloudConfig InitConfig()
 {
     try
     {
         var result = new SendCloudConfig()
         {
             ApiConfig            = ConfigHelper.GetInstance().GetSection <SendCloudApiConfig>(typeof(SendCloudApiConfig).Name),
             SendConfig           = ConfigHelper.GetInstance().GetSection <SendConfig>(typeof(SendConfig).Name, Constants.SectionGroupName),
             TemplateConfig       = ConfigHelper.GetInstance().GetSection <TemplateConfig>(typeof(TemplateConfig).Name, Constants.SectionGroupName),
             AddressListConfig    = ConfigHelper.GetInstance().GetSection <AddressListConfig>(typeof(AddressListConfig).Name, Constants.SectionGroupName),
             LabelConfig          = ConfigHelper.GetInstance().GetSection <LabelConfig>(typeof(LabelConfig).Name, Constants.SectionGroupName),
             StatusConfig         = ConfigHelper.GetInstance().GetSection <StatusConfig>(typeof(StatusConfig).Name, Constants.SectionGroupName),
             DataStatisticsConfig = ConfigHelper.GetInstance().GetSection <DataStatisticsConfig>(typeof(DataStatisticsConfig).Name, Constants.SectionGroupName),
             UserInfoConfig       = ConfigHelper.GetInstance().GetSection <UserInfoConfig>(typeof(UserInfoConfig).Name, Constants.SectionGroupName),
             BouncesConfig        = ConfigHelper.GetInstance().GetSection <BouncesConfig>(typeof(BouncesConfig).Name, Constants.SectionGroupName),
             UnsubscribesConfig   = ConfigHelper.GetInstance().GetSection <UnsubscribesConfig>(typeof(UnsubscribesConfig).Name, Constants.SectionGroupName),
             SpamReportedConfig   = ConfigHelper.GetInstance().GetSection <SpamReportedConfig>(typeof(SpamReportedConfig).Name, Constants.SectionGroupName),
             WebHookConfig        = ConfigHelper.GetInstance().GetSection <WebHookConfig>(typeof(WebHookConfig).Name, Constants.SectionGroupName),
         };
         return(result);
     }
     catch (Exception ex)
     {
         Logger.Instance.Write(ex, MessageType.Error);
         return(null);
     }
 }
コード例 #2
0
 private SendCloudConfig InitConfig()
 {
     try
     {
         var result = new SendCloudConfig()
         {
             ApiConfig = ConfigHelper.GetInstance().GetSection<SendCloudApiConfig>(typeof(SendCloudApiConfig).Name),
             SendConfig = ConfigHelper.GetInstance().GetSection<SendConfig>(typeof(SendConfig).Name, Constants.SectionGroupName),
             TemplateConfig = ConfigHelper.GetInstance().GetSection<TemplateConfig>(typeof(TemplateConfig).Name, Constants.SectionGroupName),
             AddressListConfig = ConfigHelper.GetInstance().GetSection<AddressListConfig>(typeof(AddressListConfig).Name, Constants.SectionGroupName),
             LabelConfig = ConfigHelper.GetInstance().GetSection<LabelConfig>(typeof(LabelConfig).Name, Constants.SectionGroupName),
             StatusConfig = ConfigHelper.GetInstance().GetSection<StatusConfig>(typeof(StatusConfig).Name, Constants.SectionGroupName),
             DataStatisticsConfig = ConfigHelper.GetInstance().GetSection<DataStatisticsConfig>(typeof(DataStatisticsConfig).Name, Constants.SectionGroupName),
             UserInfoConfig = ConfigHelper.GetInstance().GetSection<UserInfoConfig>(typeof(UserInfoConfig).Name, Constants.SectionGroupName),
             BouncesConfig = ConfigHelper.GetInstance().GetSection<BouncesConfig>(typeof(BouncesConfig).Name, Constants.SectionGroupName),
             UnsubscribesConfig = ConfigHelper.GetInstance().GetSection<UnsubscribesConfig>(typeof(UnsubscribesConfig).Name, Constants.SectionGroupName),
             SpamReportedConfig = ConfigHelper.GetInstance().GetSection<SpamReportedConfig>(typeof(SpamReportedConfig).Name, Constants.SectionGroupName),
             WebHookConfig = ConfigHelper.GetInstance().GetSection<WebHookConfig>(typeof(WebHookConfig).Name, Constants.SectionGroupName),
         };
         return result;
     }
     catch (Exception ex)
     {
         Logger.Instance.Write(ex, MessageType.Error);
         return null;
     }
 }
コード例 #3
0
 public SendCloudWebApi(SendCloudConfig config)
 {
     //实例化邮件 短信对象
     _emailWebApi = new EmailWebApi(config);
     _smsWebApi = new SmsWebApi(config);
 }
コード例 #4
0
 public SendCloudWebApi(SendCloudConfig config)
 {
     //实例化邮件 短信对象
     _emailWebApi = new EmailWebApi(config);
     _smsWebApi   = new SmsWebApi(config);
 }