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]
- SMTP connect() failed PHPmailer – PHP
- What is the difference between ports 465 and 587?
- Email validation in Ruby on Rails?
- Is there a way to embed an iframe in an email with text that updates?
- Sending multipart (text/html) emails via wp_mail() will likely get your domain banned
- How to set SMTP programmatically
- changing notification emails from WordPress @mydomain.net to something else
- Disable user registration password email
- Alert Email when any Post or Page is Changed
- Do something after sending email
- How do I customise the new user welcome email
- How do you update user_email on the front end in WP 3.3?
- How do you access the Product Short Description in a WooCommerce email template? [closed]
- Missing URL in password reset email
- User Without Email?
- “Reply-to Address” Email
- prevent users from changing their email address
- Disable new user notification to admin email
- Allow Duplicate Email Address for Different Users
- Email confirmation on registration
- Customizing lost password email
- Create custom welcome email without a plugin
- Include HTML template file in wp_mail
- Email sent from WordPress has HTML tags
- How to disable automated E-Mail on PHP error/exception?
- Reset Password – change from name and email address
- How do i send mail with custom Form Data using WordPress
- Email as Username in registration
- Email stats at Ma.tt contact form
- Fwd: [Website Name] Notice of Email Change [closed]
- Send all WPMU emails via SMTP
- Send mail to wordpress admin
- Send a confirmation of user role upgrade conditionally
- WP Cron emails not working
- Dynamically send pdf attached to post with contact form 7 [closed]
- Few chars getting replaced with ‘=’ in mail content in wp_mail()
- Locked out of my own blog and password reset not working
- wp_mail recipient array not sending?
- Change Password notification text on mail
- 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?
- WooCommerce lost password reset flow not working with SendGrid (redirect loop)
- On form submission how to send 2 email to different users
- How to Configure SMTP on wordpress Cant Send Email
- email wordpress users using BCC
- Contact Form 7 + Configure SMTP: Sender email appearing as my own email [closed]
- email sends from [email protected] even though I have it set to something else
- How to add line breaks to $email[‘body’] when using auto_core_update_email hook
- Preventing WooCommerce email sending only on particular conditions
- WooCommerce New customer email Hook? [closed]
- Handle registrations in WordPress when user doesn’t have any email?
- Joining confirmation email
- How to sent one form values to 2 different sites in wordpress
- How to setup SMTP for only one specific wp_mail()
- woocommerce fail to replace template string in email title [closed]
- apostrophe in email name
- Sanitizing and validating email field
- Disable WP notifications for commenting on own posts
- General Setting Allow Multiple Email Notification
- Must I change the admin user email address while changing the general email address?
- User invite email not delivered – related to subdomain?
- Woocommerce HTML email option unavailable
- WooCommerce: display text instead of raw checkbox value email
- Editing Header Titles of each details in woocommerce Order Email [closed]
- Can I configure WordPress to use postfix without a plugin?
- Ability to download only after email supplied [closed]
- Batch Emails with wp_mail()
- Email notification after registration in WordPress
- Woocommerce : How to attach an custom attachment with customer-processing-order.php email template [closed]
- Subscribe from another website to the same list [closed]
- WooCommerce email text based on category && shipping zone && payment method [closed]
- Trigger Woocommerce New User Email
- Obfuscating Email Addresses in Form Fields
- WooCommerce: Email Notifications
- Email ‘from address’ has a www in it
- How to validate website field in contact form 7?
- How to Change WooCommerce new order email?
- Trigger WordPress Actions from Email?
- WordPress E-mail Config
- Is there no way to send email using SMTP without plugin or custom coding?
- How to change WordPress email notification sender?
- Woocommerce email template customization [closed]
- Contact form sender email
- woocommerce_email_attachments filter arguments [closed]
- PHP mail() works but wp_mail() does not
- Send email daily from WordPress site
- WordPress Add New User – Send an Activation Email
- Send email only upon draft
- Mechanism to send to users of secured WordPress install new notifications by SMS or email?
- Setting up 2 SMTP accounts: 1 for wordpress and 1 for woocommerce
- Send a custom WooCommerce email when custom order change [closed]
- WordPress ‘on behalf of’ email
- WooCommerce: The model of e-mail is displaying only the html, not css [closed]
- How do I hide the purchase note in the WooCommerce ‘order completed’ email?
- Set a condition based on WooCommerce checkout city field while placing order
- Add custom order meta to Order Completed email
- How to change the Customer new account email
- Sending emptys emails every day, How stop it?
- wordpress do not let user registered with info@ email and other reserved emails to get registered by users