Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save greenhornet79/57be0d237ed28e8eacd1ea1b20e34edc to your computer and use it in GitHub Desktop.
Save greenhornet79/57be0d237ed28e8eacd1ea1b20e34edc to your computer and use it in GitHub Desktop.
<?php
add_action( 'leaky_paywall_failed_payment', 'zeen101_send_payment_failed_notification' );
function zeen101_send_payment_failed_notification( $user ) {
$to = $user->user_email;
$subject = 'Your payment to XXXX Publication has failed';
$body = 'We are sorry to inform you that your attempt at payment for XXXX Publication has failed. Please <a href="https://yourdomain.com/my-account/">log in to your account</a> on XXXX Publication and update your credit card information.';
$headers = array('Content-Type: text/html; charset=UTF-8','From: XXXX Publication <[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