How it Works
By default, Paid Memberships Pro will send members an email notice 7 days prior to their expiration date. Use this add on to send notifications at additional intervals. It also allows you to set a custom email message for each additional interval (i.e. send a custom message at the 30 day and 60 days from expiration point).
- Upload the ‘pmpro-extra-expiration-warning-emails’ directory to the ‘/wp-content/plugins/’ directory of your site.
- Activate the plugin through the ‘Plugins’ menu in WordPress.
Customizing the Email Frequency
By default, the Add On will send emails at 90, 60, and 30 days prior to membership expiration. If you would like to send the notice at other intervals, you must use a custom filter for the
pmproeewe_email_frequency_and_templates array. See the recipe below for an example:
Customize this code with your desired frequencies then add it to a helper PMPro Customizations plugin.
Customizing the Email Template
By default, the Add On will send the
membership_expiring notification email to your member. If you would like to send a different email, you must use a custom filter (below) for the
pmproeewe_email_frequency_and_templates array as well as create a custom .html email template in your theme.
The custom email template must be in the .html format and placed in the subfolder structure
YOUR-ACTIVE THEME-FOLDER/paid-memberships-pro/email. You can copy the “membership_expiring.html” template from the
plugins/paid-memberships-pro/email/ folder as a basis for your message. You can send a different expiration notice email at each frequency, for example the final email could have a discount or other offer for renewal.
Customize this code with your desired frequencies and template names then add it to a helper PMPro Customizations plugin.
Testing the Expiration Warning Email
You can test that the expiration warning messages are working properly by adding the request variables
pmproeewe_test_date=YYYY-MM-DD to the URL of your site. Note that you must be logged in as the administrator when you do this and enable WP_DEBUG. If the test is successful, no actual emails will be sent, but a note will print to your debug log file prefixed with the note
PMPROEEWE: and details to confirm whether the test was successful.
You can substitute the
YYYY-MM-DD with an actual date to simulate the day the test is supposed to treat as the test date (i.e. if I have a configuration for sending a message 7 days before expiration, use today’s date – (minus) 7 days).
The URL to test would be of the format:
The first few times this code runs, it will send expiration notices to members expiring up to and including each level. For example, if 30, 60, 90 day notices are set up:
- members expiring within 30 days will receive the 30 day notice
- members expiring within 31 to 60 days will receive the 60 day notice
- members expiring within 61 to 90 days will receive the 90 day notice
This is just for the Add On to “catch up” with members somewhere in between the intervals specified.