0

So, I have been trying to set up "reply-to" in the order email.

I have few ideas to do it. Here is one of them.

Following is admin option to set up "From" email address

    array(
            'title'             => __( '"From" Email Address', 'woocommerce' ),
            'desc'              => '',
            'id'                => 'woocommerce_email_from_address',
            'type'              => 'email',
            'custom_attributes' => array(
                'multiple' => 'multiple'
            ),
            'css'               => 'min-width:300px;',
            'default'           => get_option( 'admin_email' ),
            'autoload'          => false
        ),

As you can see, the default value is admin_email.

I am trying to change it to billing_email from the order

<?php echo $order->billing_email; ?>

In this method (if works), then all the order email will be "sent" from the customer's email (billing_email) instead of admin_email. Therefore the recipient can reply directly to that billing_email instead of Admin_email.

How can I change the default value to billing_email?

Thanks

1

The 'woocommerce_email_settings' filter is what you need.

function prefix_change_from_email( $args ) {    
    global $wpo_wcpdf;
    for( $i = 0; $i < sizeof( $args ); $i++ ) {
        if( 'woocommerce_email_from_address' == $args[ $i ]['id'] ) {
            $args[ $i ]['default'] = $wpo_wcpdf->billing_email();
            return $args;
        }
    }       
    return $args; // just in case
}
add_filter( 'woocommerce_email_settings', 'prefix_change_from_email', 15 );
  • So, I used the function above to change the default value. But it looks like there is a plugin that overwrites them. Now, I am thinking of editing that plugin so I can change the default value. Would you be able to take a look at the post? wordpress.stackexchange.com/questions/183294/… – steve Kim Apr 5 '15 at 23:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.