if (isset($_POST)) { webhooks_debug("category: '" . $_POST["event"] . "' for: " . $_POST["recipient"]); if (verify($webhooks_mailgun_api_key, $_POST["token"], $_POST["timestamp"], $_POST["signature"]) == true) { if (filter_var($_POST["recipient"], FILTER_VALIDATE_EMAIL)) { switch ($_POST["event"]) { case "dropped": webhooks_soft_bounce($_POST["recipient"], $_POST["code"]); break; case "bounced": webhooks_soft_bounce($_POST["recipient"], $_POST["code"]); break; case "complained": webhooks_spam_report($_POST["recipient"]); break; case "error": event_error($_POST["event"]); break; default: webhooks_debug(" == Invalid category: '" . $_POST["event"] . "' for: " . $_POST["recipient"] . " =="); } } else { // invalid email address webhooks_debug(" == Invalid email address: '" . $_POST["recipient"] . "' =="); } // if (filter_var($event["recipient"],FILTER_VALIDATE_EMAIL)) } else { // if(verify) webhooks_debug(" == Invalid request: '" . $_POST["Message-Id"] . "' =="); } } // foreach($events as $event)
webhooks_soft_bounce($event["recipient"], $event["status-code"]); break; case "bounce": webhooks_soft_bounce($event["recipient"], $event["status-code"]); break; case "blocked": event_blocked($event); break; case "spam_report": webhooks_spam_report($event["recipient"]); break; case "filtered": event_filtered($event); break; case "error": event_error($event); break; default: webhooks_debug(" == Invalid category: '" . $event["category"] . "' for: " . $event["recipient"] . " =="); } } else { // invalid email address webhooks_debug(" == Invalid email address: '" . $event["recipient"] . "' =="); } // if (filter_var($event["recipient"],FILTER_VALIDATE_EMAIL)) } // foreach($events as $event) //----------------------------------------------------------------------------------// // CRITSEND EVENTS UNHANDLED BY WEBHOOKS //----------------------------------------------------------------------------------// function event_open($event)