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); } }
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; } }
public SendCloudWebApi(SendCloudConfig config) { //实例化邮件 短信对象 _emailWebApi = new EmailWebApi(config); _smsWebApi = new SmsWebApi(config); }