Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Tenzing
/
Tz Tools
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
58de2c30
authored
2024-03-25 11:36:27 -0400
by
Jeff Balicki
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
my_unsubscribe_mandrill_endpoint
Signed-off-by: Jeff <jeff@gotenzing.com>
1 parent
867b97fe
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
com/Notifications/Notifications.php
com/Notifications/Notifications.php
View file @
58de2c3
...
...
@@ -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
...
...
Please
register
or
sign in
to post a comment