public async Task <SendSmsResult> SendSms(SmsMessage sms) { using (CommsApiInterface comms = new CommsApiInterface(config.ApiAddress, config.Username, config.Password)) { return(await comms.SmsApi.SendSmsAsync(sms)); } }
public async Task <SendEmailResult> SendEmailStream(SendEmailStream email) { using (CommsApiInterface comms = new CommsApiInterface(config.ApiAddress, config.Username, config.Password)) { return(await comms.EmailApi.SendEmailAsStreamAsync(email)); } }
public async Task <ICollection <SendSmsResult> > SendSmses(ICollection <SmsMessage> smses) { using (CommsApiInterface comms = new CommsApiInterface(config.ApiAddress, config.Username, config.Password)) { var result = new List <SendSmsResult>(); foreach (var sms in smses) { result.Add(await comms.SmsApi.SendSmsAsync(sms)); } return(result); } }
public async Task <ICollection <SendEmailResult> > SendEmailStreams(ICollection <SendEmailStream> emails) { using (CommsApiInterface comms = new CommsApiInterface(config.ApiAddress, config.Username, config.Password)) { var result = new List <SendEmailResult>(); foreach (var email in emails) { result.Add(await comms.EmailApi.SendEmailAsStreamAsync(email)); } return(result); } }