Not sure what the WC_Email
class does exactly, but if the $headers
argument is an array of headers, then you’re almost there. To interpolate a variable value into a string in PHP you don’t have to do the <?php ...
stuff because it’ll be rendered as is. Instead, you can use:
$headers = array( "Reply-To: {$order->billing_email}" );
Or:
$headers = array( 'Reply-To: ' . $order->billing_email );
Or:
$headers = array( sprintf( 'Reply-To: %s', $order->billing_email ) );
Also, if the billing e-mail address is user input, don’t forget to validate it with is_email()
and/or sanitize it with sanitize_email()
.
Hope that helps.
Related Posts:
- Woo-Commerce Send mail by code. [closed]
- Email validation in Ruby on Rails?
- Is there a way to embed an iframe in an email with text that updates?
- Do something after sending email
- How do I customise the new user welcome email
- “Reply-to Address” Email
- Create custom welcome email without a plugin
- Email as Username in registration
- Email stats at Ma.tt contact form
- Send a confirmation of user role upgrade conditionally
- Dynamically send pdf attached to post with contact form 7 [closed]
- wp_mail recipient array not sending?
- Transferring contact form input to an email account without using an email-proxy
- Should I use the standard wp_mail() function for a premium theme?
- How to Configure SMTP on wordpress Cant Send Email
- How to add line breaks to $email[‘body’] when using auto_core_update_email hook
- Preventing WooCommerce email sending only on particular conditions
- woocommerce fail to replace template string in email title [closed]
- apostrophe in email name
- Disable WP notifications for commenting on own posts
- User invite email not delivered – related to subdomain?
- Can I configure WordPress to use postfix without a plugin?
- Ability to download only after email supplied [closed]
- Woocommerce : How to attach an custom attachment with customer-processing-order.php email template [closed]
- Obfuscating Email Addresses in Form Fields
- How to validate website field in contact form 7?
- How to Change WooCommerce new order email?
- How to change WordPress email notification sender?
- PHP mail() works but wp_mail() does not
- Send a custom WooCommerce email when custom order change [closed]
- Set a condition based on WooCommerce checkout city field while placing order
- Sending emptys emails every day, How stop it?
- WooCommerce – Email admin with new user details
- WP mail sent to MS Exchange recipients = occasional email corruption?
- How to set custom from email address in wp
- How do I make WordPress send an email to the user when his account gets approved (manual by me)
- How to translate WordPress Emails?
- Adding extra email address who receives email like admin – woocommerce
- Share pdf with a friend via email [closed]
- Emails not getting delivered to Hotmail addresses
- Email user on WordPress upgrade
- How to change this simple code so that it sends the email notification after payment in WooCommerce?
- Woocommerce Email attachments not working – file not being attached
- Prevent sending emails on user creation in OOP context?
- how to email username and password to admin of new registration
- Add shipping address to Woocommerce order emails [closed]
- WordPress get_the_content losing formatting when emailed
- Retrieve duration since sign up
- Send email when publish new post in certain categories
- show a little contact form in homepage without plugin
- Automatically email daily archive
- Content of post does not end up in “ShareThis” mail
- reply via email link under each post
- WordPress email could not be sent
- How to differentiate between email subscription list and blog subscription list?
- Is there a way to follow a WordPress site by email alerts for new posts? [closed]
- How to stop WordPress from sending mails?
- Resend password chosen by WP administrator? [duplicate]
- Auto Log In Users after registration and send confirmation email
- Changing old email to new email, lost the password
- Using PHP mail; getting Header warning
- Images in wp_mail not showing
- Send confirmation email when a user’s role is upgraded
- Why would it take four reset password attempts to finally get the e-mail?
- Emailing system monitoring with WP
- WordPress WooCommerce email notifications going to spam folder
- Mailing issues with wordpress?
- I want to setup a button/popup/whatever that will prompt users on the site to input their email address
- User Without Email?
- WordPress new user email formatting issues
- Email sent from WordPress has HTML tags
- email saying that was not possible to send the email
- Access custom meta_data in processing order email
- Life after Feedburner and their email subscription
- Email Notify author of posts if content is out of date (older than 6 months)
- could not call wp_email function twice
- I want to fusion the product columns in email table order
- Remove wpautop from retrieve_password_message
- WordPress won’t let me change my administration email address
- How to send Woocommerce Customer Details (Name, Email and Phone Number) to Admin upon signup
- Email post to submitter
- How can I send an email to a user when a post in their category changes
- Send a different “thank you” email based on payment method
- WordPress eMails not working
- Notification Email Address not changing
- Contact Form 7 How to Alter the From email address?
- Custom Welcome Email | WordPress
- Get value from an input field and pass into update_meta_data as $meta_value
- Check if “Send the new user an email about their account” is ticked
- Conditional email recipient based off Shipping Method [closed]
- WP Mail isn’t sending user account messages, does send from plugins
- Contact forms not sending mails
- Email Piping using google apps within WP Engine
- is_email() function Not Validating within Foreach Loop
- Garbled Code added to Email Field at ‘Quick Edit’ comment screen
- Can we validate user email changes?
- Is there a way to get the site_url in HTML code?
- What is the correct way to send multipart email in wordpress?
- Output fields manually in Woocommerce email templates
- Why does WordPress not send the user the email to add a password?