Esempio n. 1
0
        /// <summary>
        /// 发送普通短信
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task <OperationResult <int> > SendSmsAsync(SendTemplateSmsRequest request)
        {
            var result = await _Client.SendSmsAsync(request).ConfigureAwait(false);

            result.ThrowIfException(true);
            if (!result.Success)
            {
                _logger.Error($"SmsService SendSmsAsync fail => ErrorCode ={result.ErrorCode} & ErrorMessage ={result.ErrorMessage}");
            }
            return(result);
        }
 /// <summary>
 /// Sends a single SMS message.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='subscriptionId'>
 /// Consumer subscription Id
 /// </param>
 /// <param name='request'>
 /// </param>
 public static object SendSms(this ISmsClient operations, System.Guid subscriptionId, SendSmsRequest request)
 {
     return(operations.SendSmsAsync(subscriptionId, request).GetAwaiter().GetResult());
 }