Skip to content

Instantly share code, notes, and snippets.

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 kimcoleman/9635301f71ce767e5634d56fac7beedb to your computer and use it in GitHub Desktop.
Save kimcoleman/9635301f71ce767e5634d56fac7beedb to your computer and use it in GitHub Desktop.
Filter the settings of email frequency and custom email template when using the Extra Expiration Warning Emails Add On
<?php
/**
* Filter the settings of email frequency and template sent when using the Extra Expiration Warning Emails Add On
* https://www.paidmembershipspro.com/add-ons/extra-expiration-warning-emails-add-on/
*
* Update the $settings array to your list of number of days => 'template_name'. The example below uses a custom
* email template added to your active theme in a new 'paid-memberships-pro/emails' custom folder.
* The email file name is listed without its .html extension.
*/
function custom_pmproeewe_email_frequency_and_templates( $settings = array() ) {
$settings = array(
60 => 'membership_expiring_1',
30 => 'membership_expiring_2',
10 => 'membership_expiring_3',
);
return $settings;
}
add_filter( 'pmproeewe_email_frequency_and_templates', 'custom_pmproeewe_email_frequency_and_templates', 10, 1 );
@ideadude
Copy link

A version of this code that also sets up the email templates so you can edit them from the Memberships -> Settings -> Email Templates page in the admin dashboard can be found here: https://gist.github.com/ideadude/3ab0197ba67084b671a4eec5983f9f01

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment