$result = $query->execute(array($key, $uid));
     if (!OC_DB::isError($result)) {
         $row = $result->fetchRow();
         $mail = $row['configvalue'];
     }
     $txtmsg = '<html><p>Hi, ' . $uid . ', <br><br>';
     $txtmsg .= '<p>find your OTP Configuration<br>';
     $txtmsg .= 'User Algorithm : ' . $mOtp->GetUserAlgorithm() . '<br>';
     if ($mOtp->GetUserPrefixPin()) {
         $txtmsg .= 'User Pin : ' . $mOtp->GetUserPin() . '<br>';
     }
     $txtmsg .= 'User Token Seed : ' . $UserTokenSeed . "<br>";
     $txtmsg .= 'User Token Time Interval Or Last Event : ' . (strtolower($mOtp->GetUserAlgorithm()) === 'htop' ? $mOtp->GetUserTokenLastEvent() : $mOtp->GetUserTokenTimeInterval()) . "<br>";
     $txtmsg .= 'Token Url Link : ' . $mOtp->GetUserTokenUrlLink() . "<br>";
     $txtmsg .= 'With android token apps select base32 before input seed<br>';
     $txtmsg .= '<img src="data:image/png;base64,' . base64_encode($mOtp->GetUserTokenQrCode($mOtp->GetUser(), '', 'binary')) . '"/><br><br>';
     $txtmsg .= $l->t('<p>This e-mail is automatic, please, do not reply to it.</p></html>');
     if ($mail !== NULL) {
         try {
             $result = OC_Mail::send($mail, $uid, '[' . getenv('SERVER_NAME') . "] - OTP", $txtmsg, 'Mail_Notification@' . getenv('SERVER_NAME'), 'Owncloud', 1);
             OCP\JSON::success(array("data" => array("message" => $l->t("email sent to " . $mail))));
         } catch (Exception $e) {
             OCP\JSON::error(array("data" => array("message" => $l->t($e->getMessage()))));
         }
     } else {
         //echo "Email address error<br>";
         OCP\JSON::error(array("data" => array("message" => $l->t("Email address error : " . $mail))));
     }
 } else {
     if ($_POST && ($_POST["otp_action"] === "create_otp" || $_POST["otp_action"] === "replace_otp")) {
         if ($mOtp->CheckUserExists($uid) && $_POST["otp_action"] === "replace_otp") {