Skip to content

Instantly share code, notes, and snippets.

View jescott2's full-sized avatar

Miner77 jescott2

View GitHub Profile
@andrewlimaza
andrewlimaza / pmpro-change-admin-to-email.php
Created February 14, 2020 08:55
Change Admin "To" address for admin emails [Paid Memberships Pro]
<?php
/**
* Change the "To:" header for admin emails for Paid Memberships Pro.
* Follow this guide to add custom code to your site - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_change_admin_to_email( $headers, $email ){
if( strpos( $email->template, "_admin" ) !== false ) {
//add different email for admin emails.
$headers[] = "To: " . "[email protected]";