Support » Plugin: WooCommerce » Create New Email Template Base On Custom Order Status

  • Hi everybody!

    I created two status order in my plugin, and I need to create two email template NOT OVERWRITE, I copied the classes that already have WooCommerce, my problem is that my custom email template is not found, it is as if the file did not exist.

    i tried:

    in the construct:
    $this->template_html = 'emails/customer-mycustomstatus-order.php';

    in the function “get_content_html”:

    wc_get_template( $this->template_html, array(
    'order' => $this->object,
    'email_heading' => $this->get_heading(),
    'sent_to_admin' => false,
    'plain_text'    => false
    ), '/wp-content/plugins/myplugin/woocommerce/', '/wp-content/plugins/myplugin/woocommerce/' );
    return ob_get_clean();

    I also tried filtering “woocommerce_locate_template”:

    if ( $template_name == 'emails/customer-mycustomstatus-order.php' ) {
    $template = _MYPLUGIN_ABSPATH_.'/'.$template_name;

    and never get the file, please, I’m doing wrong?

  • The topic ‘Create New Email Template Base On Custom Order Status’ is closed to new replies.