Register a template slug and its directory. Create the corresponding template files in the supplied path before selecting the template in a workflow.
Developer note:
Add custom PHP in a small custom plugin or child theme, and test it on a staging site before production. This example requires ongoing maintenance when extension APIs change.
functions.php
<?php
add_filter( 'automatewoo_email_templates', 'my_store_automatewoo_email_templates' );
/**
* Register a custom AutomateWoo email template.
*
* @param array $templates Registered templates.
* @return array
*/
function my_store_automatewoo_email_templates( $templates ) {
$templates['my-store'] = array(
'template_name' => __( 'My Store email', 'my-store' ), // phpcs:ignore WordPress.WP.I18n.TextDomainMismatch
'from_name' => 'My Store',
'from_email' => 'email@example.org',
'path' => __DIR__ . '/templates/my-store',
);
return $templates;
}