Skip to content

Instantly share code, notes, and snippets.

@greenhornet79
Created June 27, 2022 17:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save greenhornet79/2189a0b28f55d7147ebd06691365f43a to your computer and use it in GitHub Desktop.
Save greenhornet79/2189a0b28f55d7147ebd06691365f43a to your computer and use it in GitHub Desktop.
<?php
/* two actions
leaky_paywall_stripe_invoice_payment_succeeded
leaky_paywall_stripe_payment_intent_succeeded
*/
add_action( 'leaky_paywall_stripe_invoice_payment_succeeded', 'zeen_send_renewal_email_notification', 10, 2 );
function zeen_send_renewal_email_notification( $user, $stripe_object ) {
$to = 'admin@example.com';
$subject = 'Renewal Payment Notification';
$body = 'A renewal payment succeeded for' . $user->user_email;
$headers = array('Content-Type: text/html; charset=UTF-8','From: My Site Name <support@example.com');
wp_mail( $to, $subject, $body, $headers );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment