The User Pages Add On for Paid Memberships Pro creates personalized pages for each member. Sometimes you may want to notify members when their page is updated by a site administrator, for example, when new content is added or files are uploaded.

This code recipe will automatically send an email to a member whenever their user page is edited or updated by a site administrator, keeping them informed of important changes. This improves communication and ensures members never miss updates related to their account.

Featured Image for Send a Member an email when their User Page is updated

Understanding the save_post Action

This code hooks into the save_post action in WordPress. Each time a post is updated, it checks whether the update belongs to a member’s User Page (or one of its child pages). If so, the function prepares and sends an email to that member.

Screenshot of an Email Notification after a User Page Has Been Updated

About the Code Recipe

This code recipe automatically emails a member when their User Page (created by the User Pages Add On) is updated by an administrator.

The Code Recipe

How to Customize This Code Recipe

This recipe works as-is to send an automated email to the member when their user page is updated. 

You can customize this further by modifying the email content sent to the member on lines 53 through 66 of the above code snippet. To do this, you would;

  • Change the email body content from lines 57 to 61 
  • Change the email subject on line 55 to your preferred subject

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.

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.

Featured Image for Membership Site Development Course: The Basics


Was this article helpful?
YesNo