Last active
December 13, 2021 19:40
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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