Created
June 17, 2017 15:07
-
-
Save strangerstudios/82d63fbe07166832cf2ee860c090f0e9 to your computer and use it in GitHub Desktop.
Example of using the pmproet_templates filter in the PMPro Email Templates addon to add your own email templates.
This file contains 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
/* | |
If you add this code into a plugin, then the PMPro Email Templates addon | |
will allow you to set/change the body of the email through its UI. | |
You can then send an email using this template using code like: | |
$email = new PMProEmail(); | |
$email->template = 'my_email_template_name'; | |
$email->email = 'email@youaresendingto.com'; | |
$email->send(); | |
*/ | |
function my_pmproet_template_callback($templates) { | |
$templates['my_email_template_name'] = array( | |
'subject' => 'My Subject Line', | |
'description' => 'My Email Template Name', | |
); | |
return $templates; | |
} | |
add_filter( 'pmproet_templates', 'my_pmproet_template_callback'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment