• Hi,

    I wanted to set a different Reply To email ID to the email sent by your plugin.

    I tried using multiple code snippets which work WELL with default Woocommerce emails but seem to have a problem with your plugin email.

    Code1

    add_filter( 'woocommerce_email_headers', 'dcwd_woocommerce_email_headers', 10, 4 );
    function dcwd_woocommerce_email_headers( $header, $email_id, $email_for_obj, $email_class ) {
    	if ( 'ywraq_email' == $email_id ) {
    	$header = 'Reply-to: [email protected]' . "\r\n";
    	}
    	return $header;
    }

    Code2

    add_filter( 'woocommerce_email_headers', 'add_reply_to_certain_emails', 10, 2 );
    function add_reply_to_certain_emails ($headers, $object ) {
    	$add_reply_to = array(
    		'customer_on_hold_order',
    		'customer_processing_order',
    		'customer_completed_order',
    		'customer_refunded_order',
    		'customer_invoice',
    		'customer_note',
    		'customer_reset_password',
    		'customer_new_account',
    		'ywraq_email',
    		);
    	if ( in_array( $object, $add_reply_to ) ) {
    		$headers = array( 
    			$headers,
    			'Reply-to:  Domain.com <[email protected]>' ."\r\n",
    			);
    	}
    	return $headers;
    }

    When testing with BOTH code snippets separately, I get the below error in my local installation.

    [12-Jun-2020 10:51:24 UTC] PHP Warning:  strpos() expects parameter 1 to be string, array given in F:\laragon\www\iGMS\wp-includes\pluggable.php on line 240
    [12-Jun-2020 10:51:24 UTC] PHP Warning:  trim() expects parameter 1 to be string, array given in F:\laragon\www\iGMS\wp-includes\pluggable.php on line 248
    [12-Jun-2020 10:51:24 UTC] PHP Notice:  Undefined offset: 1 in F:\laragon\www\iGMS\wp-includes\pluggable.php on line 248

    This warning is shown ONLY when I trigger the Quote email.

    Please review and guide me on how to fix this. Please let me know in case you require any additional information.

    Thanks

  • The topic ‘PHP Warning – Debug.log’ is closed to new replies.