Forked from strangerstudios/my_pmpro_emails_custom_template_path.php
Last active
April 3, 2021 04:07
-
-
Save ideadude/da9adda0101d4f819551b1762f2ac737 to your computer and use it in GitHub Desktop.
Tell PMPro to look in the pages directory of this plugin for PMPro email templates.
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 | |
/* | |
Tell PMPro to look in the pages directory of this plugin for PMPro email templates. | |
Add this code to a custom plugin. | |
Make sure that there is a /email/ directory in the plugin directory with your templates in it. | |
*/ | |
function my_pmpro_email_custom_template_path($default_templates, $page_name) { | |
$default_templates[] = dirname(__FILE__) . '/email/' . $page_name . '.html'; | |
return $default_templates; | |
} | |
add_filter('pmpro_email_custom_template_path', 'my_pmpro_email_custom_template_path', 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This recipe is included in the blog post on "How to Load a Custom Template for Membership Pages or System-Generated Emails" at Paid Memberships Pro here: https://www.paidmembershipspro.com/new-method-load-custom-templates-pmpro-generated-pages-system-generated-emails/