Beispiel #1
0
        /*
         * 发送短信
         */
        public void testBatchSend(SmsClient smsClient)
        {
            //3. 设置请求参数
            BatchSendRequest request = new BatchSendRequest();

            request.RegionId = "cn-north-1";
            // 设置模板ID 应用管理-文本短信-短信模板 页面可以查看模板ID
            request.TemplateId = "{{TemplateId}}";
            // 设置签名ID 应用管理-文本短信-短信签名 页面可以查看签名ID
            request.SignId = "qm_0571ace54ebf4b1dbdb2000b4d16dd4a";
            // 设置下发手机号list
            List <string> phoneList = new List <string>()
            {
                "13800138000"
                // ,
                // "phone number"
            };

            request.PhoneList = phoneList;
            // 设置模板参数,非必传,如果模板中包含变量请填写对应参数,否则变量信息将不做替换
            List <string> param = new List <string>()
            {
                "123456"
            };

            request.Params = param;

            //4. 执行请求
            var response = smsClient.BatchSend(request).Result;

            Console.WriteLine(JsonConvert.SerializeObject(response));
            Console.ReadLine();
        }
Beispiel #2
0
        private static async Task <JdCloudSmsResult> CoreProcessAsync(SmsClient client, BatchSendRequest request)
        {
            var response = await client.BatchSend(request);

            return(new JdCloudSmsResult(response));
        }