public async Task <IActionResult> PromoSms(PromoSmsViewModel vm) { if (!ModelState.IsValid) { return(View(vm)); } else { var mobiles = _marketingRepo.GetAllMobiles(); var resources = await _smsRepo.GetFormattedNumbers(mobiles); if (_env.IsProduction()) { foreach (var phone in resources) { await _smsRepo.SendSms(phone, vm.Body); } } return(RedirectToAction("Index", "Admin")); } }