public async Task <ActionResult> RequestSmsCode([FromBody] RequestSmsCodeRequest request)
        {
            //TODO EVITAR ENVIAR MENSAJES MUY RAPIDOS QUIZAS HABILITADO SOLO EN PRODUCCION
            var code = await _authenticationAppService.RequestSmsCodeAsync(request.Phone);

            var message = $"{_resources.GetStringResource(LocalizationKeys.DistributedServices.messages_RequestCodeMessage)} {code}";

            _smsManager.Send(request.Phone, message);
            return(Ok(new RequestSmsCodeResponse {
                IsValidPhoneNumber = true
            }));
        }
Exemplo n.º 2
0
        public void SMSSendTest()
        {
            try
            {
                IMessageBox msgBox    = new MessageBox(config);
                ISMSManager manager   = new SMSManager(config, msgBox);
                int         sentCount = manager.Send();

                logger.LogInformation($"SMSSendTest sent out {sentCount} message(s)");
            }
            catch (Exception e)
            {
                logger.LogError(e.Message + "\r\n" + e.StackTrace);
                throw e;
            }
        }
Exemplo n.º 3
0
 protected void BtnSendTestSMS_OnClick(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         try
         {
             if (SMSManager.Send("Test message", txtTestPhone.Text))
             {
                 lblSendTestSmsResult.Text = GetLocaleResourceString("Admin.GlobalSettings.SMSAlerts.SendTestSMSSuccess");
             }
             else
             {
                 lblSendTestSmsResult.Text = GetLocaleResourceString("Admin.GlobalSettings.SMSAlerts.SendTestSMSFail");
             }
         }
         catch (Exception exc)
         {
             lblSendTestSmsResult.Text = exc.Message;
         }
     }
 }