mercredi 11 novembre 2015

WooCommerce custom WC_Email template file

I've got a plugin that I'm trying to add custom email functionality to.

The custom email and hook to send it are all working fine, however I'm getting stumped when it comes to getting a custom template for the email setup.

$this->template_html  = 'emails/custom-template.php';
$this->template_plain = 'emails/plain/custom-template.php';

This works fine if I put the custom-template.php file into woocommerce temlate emails folder, or into the current theme. How would I make this look in a emails directory in my plugin root? I've seen a few examples online using woocommerce_locate_core_template and woocommerce_template_directory hooks, but all the examples are for overwriting all templates not just one or two.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire