Created
July 31, 2024 17:37
-
-
Save greenhornet79/587cce215eee73db07f22b96ad5d2bfb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Send an email to the subscriber when Authorize.net sends a net.authorize.customer.subscription.expired webhook event | |
// Notice the action is the event name, with the periods changed out for underscores | |
// Any event can be accessed that way | |
add_action('leaky_paywall_net_authorize_customer_subscription_expired', 'zeen_send_expired_notice', 10, 2); | |
function zeen_send_expired_notice($user, $webhook_data) | |
{ | |
$to = $user->user_email; | |
$subject = 'Your subscription has expired'; | |
$body = 'Your subscription has expired. Please renew here: https://example.com'; | |
$headers = array('Content-Type: text/html; charset=UTF-8', 'From: My Site Name <[email protected]'); | |
wp_mail($to, $subject, $body, $headers); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment