コード例 #1
0
 public async Task <SendSmsResult> SendSms(SmsMessage sms)
 {
     using (CommsApiInterface comms = new CommsApiInterface(config.ApiAddress, config.Username, config.Password))
     {
         return(await comms.SmsApi.SendSmsAsync(sms));
     }
 }
コード例 #2
0
 public async Task <SendEmailResult> SendEmailStream(SendEmailStream email)
 {
     using (CommsApiInterface comms = new CommsApiInterface(config.ApiAddress, config.Username, config.Password))
     {
         return(await comms.EmailApi.SendEmailAsStreamAsync(email));
     }
 }
コード例 #3
0
        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);
            }
        }
コード例 #4
0
        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);
            }
        }