Skip to content

Instantly share code, notes, and snippets.

@strangerstudios
Created June 17, 2017 15:07
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save strangerstudios/82d63fbe07166832cf2ee860c090f0e9 to your computer and use it in GitHub Desktop.
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.
/*
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