Created
November 28, 2022 15:21
-
-
Save dparker1005/5080a6b6a0cf10a087bc00a8fe42bc5b to your computer and use it in GitHub Desktop.
If the cancellation email is being sent because of a cancelled payment subscription, then send a different email body.
This file contains 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 | |
// Copy from below this line. | |
/** | |
* If the cancellation email is being sent because of a cancelled payment subscription, | |
* then send a different email body. | |
*/ | |
function my_pmpro_email_body_cancelled_subscription( $body, $email ) { | |
if ( $email->template == 'cancel' && pmpro_doing_webhook() ) { | |
$body = 'Your subscription has been cancelled.'; | |
} | |
return $body; | |
} | |
add_filter( 'pmpro_email_body', 'my_pmpro_email_body_cancelled_subscription', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment