1
Hello,
I have a big problem in this part, I would like to set the name of the Customer instead of only the E-mail when clicking Reply. Below the code I used to work "Reply To":
add_filter( 'woocommerce_email_headers', 'add_reply_to_wc_admin_new_order', 10, 3 );
function add_reply_to_wc_admin_new_order( $headers = '', $id = '', $order ) {
if ( $id == 'new_order' ) {
$headers .= "Reply-To: ".$order->billing_email."\r\n";
}
return $headers;
}
As you can see this code works as follows, when replying to the Woocommerce’s new order email it will respond to the Customer’s Email filled in the Store’s Billing Form. I would also like to put the name of the Client.
An example I’m trying to explain is from Phpmailer that works this way:
$mailer->AddReplyTo($_POST["email"], $_POST["nome"]);
In this model of Phpmailer when clicking reply it does more or less that:
Rodrigo Macedo <[email protected]>,
Does anyone have an idea how I can do that ?
I have tried to add the code in several ways in the name in front of the E-mail similar to Phpmailer but without success...
The question seems ok to me, how do you get the customer’s name? is the
$_POST["nome"]
even?– rray
@rray So this was an example that I gave, and as for your question, that’s right, this code is used to get the name of the customer that he fills in the form, this code is by Phpmailer that I use to send authenticated forms on my Websites, in case I want to do the same thing in the Woocommerce form however as I don’t have much knowledge in programming I’m not getting..
– Rooh Macedo