Skip to content

Instantly share code, notes, and snippets.

@greenhornet79
Created August 25, 2017 12:23
Show Gist options
  • Save greenhornet79/f71fdcdd32aa4a19cb5db12ea037dbf1 to your computer and use it in GitHub Desktop.
Save greenhornet79/f71fdcdd32aa4a19cb5db12ea037dbf1 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 has failed';
$body = 'We are sorry to inform you that your attempt at payment has failed. Please <a href="https://examplesite.com/my-account/">log in to your account</a> on Example Site and update your credit card information.';
$headers = array('Content-Type: text/html; charset=UTF-8','From: Example Site <[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