Paid Memberships Pro is a popular WordPress plugin that allows you to create and manage membership levels on your website. By default, the plugin sends out email notifications to members when their membership is about to expire. That email includes a link to log into their membership account.
In this tutorial, we show you how to customize the email template with a renewal link specifically built for the active membership level that member has. While you can add any links you want to your member emails, this tutorial makes the customization even more personal. Now members have a super convenient way for members to renew their membership directly from the email.
Table of contents
About the Code Recipe
The code provided extends Paid Memberships Pro by adding a !!renew_url!!
template variable to the Membership Expiring email data. It also customizes the !!login_url!!
to append the user’s renewal link as a redirection parameter from the login page.
By adding this custom code, you will be able to start using the !!renew_url!!
or !!login_url!!
in your Membership Expiring email. As a reminder, emails can be customized from the Memberships > Settings > Email Templates screen in the WordPress admin.
The variables from the code will dynamically populate with the relevant information for that member when the email is sent.
The Code Recipe (PHP)
Adding the Recipe to Your Website
You can add this recipe to your site by creating a custom plugin or using the Code Snippets plugin available for free in the WordPress repository. Read this companion article for step-by-step directions on either method.
Testing the Renewal Links
To ensure the renewal links are working correctly, you can test the functionality by following these steps:
- Create a test membership account or use an existing one that is approaching its expiration date.
- When the Membership Expiring email is sent out, check the email received and click on the renewal link.
- Verify that the link takes you to the appropriate checkout page for the expiring membership level.
- Additionally, click on the “Log in to your membership account here” link to verify that the
redirect_to
parameter is correctly added.
This customization allows your members to conveniently renew their memberships directly from the email notification, enhancing the user experience and increasing membership retention.
Free Course: Membership Site Development—The Basics
Develop a deeper understanding of membership site development in this beginner-level course. Learn how to make your site work better, save yourself time and money, and improve your site's performance.