private const int ACCOUNT_ID = 0; // TODO: Fill in with your account ID #endregion Fields #region Methods private static Campaign CampaignSetup(T70Context context) { /* * NOTE: A campaign only needs to be setup once. * * After the initial setup you can send that campaign as many times as you would like. */ var contentRepo = context.Repository<Content>(new { AccountId = ACCOUNT_ID }); var content = new Content { Name = "SDK Test Content", }; contentRepo.Add(content); var templateRepo = context.Repository<ContentTemplate>(new { AccountId = ACCOUNT_ID, ContentId = content.Id }); var template = new ContentTemplate { LanguageType = LanguageType.English, ChannelType = ChannelType.Sms, EncodingType = EncodingType.Text, Template = "Hi there from our demo!" }; templateRepo.Add(template); var campaign = new Campaign { Name = "SDK Test Campaign", SubscriptionId = 183, CampaignType = CampaignType.Basic, ContentId = content.Id }; var campaignRepo = context.Repository<Campaign>(new { AccountId = ACCOUNT_ID }); campaignRepo.Add(campaign); return campaign; }
private static Campaign CampaignSetup(T70Context context) { var content = CreateContent(context); var sub = CreateSubscription(context); var campaign = new Campaign { Name = "SDK Test Campaign", SubscriptionId = sub.Id, CampaignType = CampaignType.Basic, ContentId = content.Id }; var campaignRepo = context.Repository<Campaign>(new { AccountId = ACCOUNT_ID }); campaignRepo.Add(campaign); return campaign; }