private static void SetDefaultClickatellClient(ClickatellConfigFileSettings clickatellConfigFileSettings, ConfigurationExpression x) { var clickatellClient = new ClickatellClient(clickatellConfigFileSettings); x.For<ClickatellClient>() .Use(new IgnoreAuthErrorClickatellClient(clickatellConfigFileSettings, new IgnoreNoCreditErrorClickatellClient(clickatellConfigFileSettings, clickatellClient))); }
public async Task TestSendSms() { var client = new ClickatellClient(new SmsKit.Data.RESTCredentials("1NddRb4U6If7rSKAiVRkUXvLCUM31VTLloXNWAQBYyC1oDgVxfcTdmpHTzMcAduVE3mPhEPvnbiAX1")); var response = await client.SendMessageAsync(new SmsKit.Data.SendMessageRequest("test message", "8613921198852")); Assert.True(response.Success); await Assert.ThrowsAnyAsync <SmsKitException>(async() => await client.SendMessageAsync(new SmsKit.Data.SendMessageRequest("test message", "13921198852"))); }
public override sealed void OnVirtualWork() { try { var message = Execute(); if (message != null) { var smsService = new ClickatellClient(); smsService.Send(message.RecipientNumber, message.MessageContent); } else throw new ClickatellException(string.Format("The return result for the execution of {0} of type {1} can not be null.", this, typeof(CloudClickatellActivity))); } catch (Exception ex) { HandleException(ex); } }