Convert some constants to enums

This commit is contained in:
Alex Cabal 2024-05-11 13:23:15 -05:00
parent 06425d3dd6
commit ee7c8343dd
52 changed files with 282 additions and 268 deletions

View file

@ -5,17 +5,14 @@ use function Safe\curl_setopt;
use function Safe\file_get_contents;
use function Safe\json_decode;
$log = new Log(POSTMARK_WEBHOOK_LOG_FILE_PATH);
try{
$log = new Log(POSTMARK_WEBHOOK_LOG_FILE_PATH);
/** @var string $smtpUsername */
$smtpUsername = get_cfg_var('se.secrets.postmark.username');
$log->Write('Received Postmark webhook.');
if(HttpInput::RequestMethod() != HTTP_POST){
throw new Exceptions\WebhookException('Expected HTTP POST.');
}
HttpInput::ValidateRequestMethod([HttpMethod::Post]);
$apiKey = get_cfg_var('se.secrets.postmark.api_key');