58de2c30 by Jeff Balicki

my_unsubscribe_mandrill_endpoint

Signed-off-by: Jeff <jeff@gotenzing.com>
1 parent 867b97fe
......@@ -757,7 +757,7 @@ function handle_unsubscribe_event($data) {
add_action('unsubscribe_event', 'handle_unsubscribe_event');
// Endpoint to receive webhook notifications
function my_custom_webhook_endpoint() {
function my_unsubscribe_mandrill_endpoint() {
// Check if request is a POST request
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
// Process webhook data
......@@ -769,8 +769,8 @@ function my_custom_webhook_endpoint() {
// Register the webhook endpoint
add_action('rest_api_init', function () {
register_rest_route('unsubscribe_event/v1', '/webhook', array(
register_rest_route('cicbv-api/v1', '/unsubscribe-mandrill', array(
'methods' => 'POST',
'callback' => 'my_custom_webhook_endpoint',
'callback' => 'my_unsubscribe_mandrill_endpoint',
));
});
\ No newline at end of file
......