Skip to content

Instantly share code, notes, and snippets.

@dparker1005
Created November 28, 2022 15:21
Show Gist options
  • Save dparker1005/5080a6b6a0cf10a087bc00a8fe42bc5b to your computer and use it in GitHub Desktop.
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.
<?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