Support » Plugin: WooCommerce » Invoice email subject filter doestn work…

  • Hello,

    Im trying to change subject of Invoice email,… filter works fine if order is “on hold”, but if order is accepted etc filter stop to work.
    Where can be problem?

    Thanks you

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support John Coy

    (@johndcoy)

    Automattic Happiness Engineer

    Hi @gorem

    Do you show any template overrides applied to the active theme at the bottom of the Status page located under WooCommerce > Status? If so, it’s likely these files are preventing the filters from overriding the email templates. You’ll want to apply your changes to those files or remove them to control what content you’d like to show using another method.

    If so, you can try activating another theme like Twenty Seventeen to see if the filters work with another theme.

    Thanks you @johndcoy!
    Unfortunately it doesnt help. Ive tried delete all overriding templates and to switch to Twenty Seventeen + those two snippets:

      	add_filter('woocommerce_email_subject_customer_invoice', 'email_subject_completed', 1, 2);
    
    	function email_subject_completed( $subject, $order ) {
    		global $woocommerce;
    		$subject = sprintf( esc_html__( 'Details / invoice for your order #%s', 'test'), $order->get_id() );
    		return $subject;
    	}

    or

    
    add_filter( 'woocommerce_email_subject_customer_invoice', 'customizing_invoice_email_subject', 10, 2 );
    	function customizing_invoice_email_subject( $formated_subject, $order ){
    		return sprintf( esc_html__( 'Details / invoice for your order #%s', 'test'), $order->get_id() );
    	}

    Do you have any other idea?
    Thanks you

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Invoice email subject filter doestn work…’ is closed to new replies.