/**
  * Constructor
  */
 public function __construct()
 {
     date_default_timezone_set(AB_Utils::getTimezoneString());
     wp_load_translations_early();
     $now = new DateTime();
     $this->mysql_now = $now->format('Y-m-d H:i:s');
     $this->sms = new AB_SMS();
     $this->sms_authorized = $this->sms->loadProfile();
     $query = AB_Notification::query()->where('active', 1)->whereIn('type', array('staff_agenda', 'client_follow_up', 'client_reminder'));
     foreach ($query->find() as $notification) {
         $this->processNotification($notification);
     }
 }
 public function executeForgotPassword()
 {
     $sms = new AB_SMS();
     $step = $this->getParameter('step');
     $code = $this->getParameter('code');
     $username = $this->getParameter('username');
     $password = $this->getParameter('password');
     $result = $sms->forgotPassword($username, $step, $code, $password);
     if ($result === false) {
         wp_send_json_error(array('message' => current($sms->getErrors())));
     } else {
         wp_send_json_success();
     }
 }