-
-
Save danielbitzer/ce1aba7e19dae2d01583f9058e74264c to your computer and use it in GitHub Desktop.
AutomateWoo - Custom 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
<?php | |
add_filter( 'automatewoo_email_templates', 'my_automatewoo_email_templates' ); | |
function my_automatewoo_email_templates( $templates ) { | |
// SIMPLE | |
// register a template by adding a slug and name to the $templates array | |
$templates['custom-1'] = 'Custom Template #1'; | |
// ADVANCED | |
// you can also create a template with a unique from name and from email by passing using the following array format | |
$templates['custom-2'] = array( | |
'template_name' => 'Custom Template #2', | |
'from_name' => 'AutomateWoo Custom', | |
'from_email' => 'custom@automatewoo.com' | |
); | |
// SETTING A CUSTOM PATH | |
// As of version 4.8, it's possible to set a custom template path | |
$templates['custom-3'] = array( | |
'template_name' => __( 'Custom Template with a custom path', 'my-plugin' ), | |
'path' => dirname( __FILE__ ) . '/templates/custom-1' | |
); | |
return $templates; | |
} |
Looking at the AutomateWoo plugin code, I cannot see how any data except the template name is being utilised when the filter is applied:
$templates = apply_filters( 'automatewoo_email_templates', self::$templates );
Appears the $template_data['path']
is stripped out, only $template_data['template_name']
is used...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
any luck solving it @charlotteoswald?