my_unsubscribe_mandrill_endpoint
Signed-off-by: Jeff <jeff@gotenzing.com>
Showing
1 changed file
with
3 additions
and
3 deletions
| ... | @@ -757,7 +757,7 @@ function handle_unsubscribe_event($data) { | ... | @@ -757,7 +757,7 @@ function handle_unsubscribe_event($data) { |
| 757 | add_action('unsubscribe_event', 'handle_unsubscribe_event'); | 757 | add_action('unsubscribe_event', 'handle_unsubscribe_event'); |
| 758 | 758 | ||
| 759 | // Endpoint to receive webhook notifications | 759 | // Endpoint to receive webhook notifications |
| 760 | function my_custom_webhook_endpoint() { | 760 | function my_unsubscribe_mandrill_endpoint() { |
| 761 | // Check if request is a POST request | 761 | // Check if request is a POST request |
| 762 | if ($_SERVER['REQUEST_METHOD'] === 'POST') { | 762 | if ($_SERVER['REQUEST_METHOD'] === 'POST') { |
| 763 | // Process webhook data | 763 | // Process webhook data |
| ... | @@ -769,8 +769,8 @@ function my_custom_webhook_endpoint() { | ... | @@ -769,8 +769,8 @@ function my_custom_webhook_endpoint() { |
| 769 | 769 | ||
| 770 | // Register the webhook endpoint | 770 | // Register the webhook endpoint |
| 771 | add_action('rest_api_init', function () { | 771 | add_action('rest_api_init', function () { |
| 772 | register_rest_route('unsubscribe_event/v1', '/webhook', array( | 772 | register_rest_route('cicbv-api/v1', '/unsubscribe-mandrill', array( |
| 773 | 'methods' => 'POST', | 773 | 'methods' => 'POST', |
| 774 | 'callback' => 'my_custom_webhook_endpoint', | 774 | 'callback' => 'my_unsubscribe_mandrill_endpoint', |
| 775 | )); | 775 | )); |
| 776 | }); | 776 | }); |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or sign in to post a comment