use unused value

This commit is contained in:
jhuesser 2018-06-07 16:30:24 +02:00 committed by Thomas Nilsen
parent d0d0572b82
commit b005e77664
1 changed files with 10 additions and 2 deletions

View File

@ -168,11 +168,19 @@ class Incident implements JsonSerializable
$firstname = $subscriberData['firstname'];
$tg_message = urlencode('Hi ' . $firstname . chr(10) . 'There is a status update on a service that you have subscribed. <a href="' . WEB_URL . '">View online</a>');
$response = json_decode(file_get_contents("https://api.telegram.org/bot" . TG_BOT_API_TOKEN . "/sendMessage?chat_id=" . $telegramID . "&parse_mode=HTML&text=" . $tg_message));
$response = json_decode(file_get_contents("https://api.telegram.org/bot" . TG_BOT_API_TOKEN . "/sendMessage?chat_id=" . $telegramID . "&parse_mode=HTML&text=" . $tg_message), true);
if($response['ok'] == true){
$tgsent = true;
}
}
}
header("Location: ".WEB_URL."/admin");
if($tgsent){
header("Location: ".WEB_URL."/admin?sent=true");
} else {
header("Location: ".WEB_URL."/admin?sent=false");
}
}
}
}