Paid Memberships Pro has a bunch of default email templates, that are triggered by different events to send to either a user/member or the admin, depending on the event (some events have two templates: one to the user, one to admin).
The plugin offers a slew of hooks and filters for customization convenience.
Here is the filters provided in the PMPro email class and its entire source on GitHub, and implementation here in the crons.
How might I be able to only change the email recipient for a particular template? And/or BCC the admin only for a particular template?
Any insight would be greatly appreciated, thanks.
By the way I am trying to achieve this in a separate plugin, you know, not edit the plugin itself, so I can keep it updated and such...
There are several ways to do this by using the hooks.
The first one that occurs to me is that you can use the pmpro_email_filter filter to modify the PMProEmail instance.
For example, the following piece of code would change the recipient email to "new_email@example.com" if the email template is "something":
add_filter('pmpro_email_filter', 'modify_email_recipient');
function modify_email_recipient($pm_pro_email) {
if ( $pm_pro_email->template == 'something' ) {
$pm_pro_email->email = 'new_email@example.com';
}
return $pm_pro_email;
}