Skip to content

Instantly share code, notes, and snippets.

@femiyb
Forked from andrewlimaza/change-pmpro-reply-to.php
Last active July 8, 2021 08:50
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 femiyb/dc0431f1032740bf34eaadc4fbc7ca18 to your computer and use it in GitHub Desktop.
Save femiyb/dc0431f1032740bf34eaadc4fbc7ca18 to your computer and use it in GitHub Desktop.
Change the "Reply-To" for emails sent to admin [Paid Memberships Pro]
<?php
/**
* Add this code to your PMPro Customizations Plugin or via a code snippets plugin.
*/
function my_pmpro_adjust_reply_to_email( $headers, $email ) {
// Add "Reply-To" header and set it to the user that just cancelled.
if( strpos($email->template, "_admin")) {
$headers[] = "Reply-To: " . $email->data['user_email'];
}
return $headers;
}
add_filter( 'pmpro_email_headers', 'my_pmpro_adjust_reply_to_email', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment