This recipe demonstrates how to use the pmpro_email_subject
filter hook to modify the email subject line of a PMPro-generated email.
The built-in Email Templates editor in PMPro allows you to modify subject lines without code. This tutorial shows how to modify subject lines with code if you need to insert additional variables or have extensive customization needs.
If you need to modify other aspects of the emails, please explore the full documentation about member emails.
The Code Recipe
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.
You can modify the email that is filtered on line 11 or the subject line that is modified on line 13.
To modify other sections of the emails, see similar hooks for pmpro_email_recipient, pmpro_email_sender, pmpro_email_sender_name, pmpro_email_template, and pmpro_email_body.
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.