admin管理员组文章数量:1322850
I searched the web for last couple of days for "Reply-to Address" in the email but had no luck so, here I am.
In my wordpress site, there are multiple store owners who can sell their products. When visitors buy a certain item (listed by different owners), that particular owner gets an email notification (Note that it is mandatory to put the visitor's email address during checkout process)
However the email is from "Admin" email account.
I searched for how to set up "reply-to" address so the owners can reply directly to the customer's email address instead of admin account.
Here is an example that I saw which I am trying to achieve:
In this image, the site is abc.ca
and the [email protected]
bought something. Then the [email protected]
got the email, which the owner can now send a reply back to the customer directly from the email.
How can I achieve something like this?
EDIT:
Here is the code that I have now:
add_filter('woocommerce_email_headers', 'my_from_reply');
function my_from_reply() {
return 'From: [email protected]' . "\r\n";
}
And this is the customer's billing email.
<?php echo $order->billing_email; ?>
How can I modify the first one to include the "billing_email" instead of "[email protected]"
Thank you
I searched the web for last couple of days for "Reply-to Address" in the email but had no luck so, here I am.
In my wordpress site, there are multiple store owners who can sell their products. When visitors buy a certain item (listed by different owners), that particular owner gets an email notification (Note that it is mandatory to put the visitor's email address during checkout process)
However the email is from "Admin" email account.
I searched for how to set up "reply-to" address so the owners can reply directly to the customer's email address instead of admin account.
Here is an example that I saw which I am trying to achieve:
In this image, the site is abc.ca
and the [email protected]
bought something. Then the [email protected]
got the email, which the owner can now send a reply back to the customer directly from the email.
How can I achieve something like this?
EDIT:
Here is the code that I have now:
add_filter('woocommerce_email_headers', 'my_from_reply');
function my_from_reply() {
return 'From: [email protected]' . "\r\n";
}
And this is the customer's billing email.
<?php echo $order->billing_email; ?>
How can I modify the first one to include the "billing_email" instead of "[email protected]"
Thank you
Share Improve this question edited Jun 15, 2020 at 8:21 CommunityBot 1 asked Mar 30, 2015 at 5:06 Steve KimSteve Kim 3752 gold badges6 silver badges21 bronze badges 4- Are you using some particular e-commerce solution? – Z. Zlatev Commented Mar 30, 2015 at 5:28
- yes. I am using woocommerce for that. =) – Steve Kim Commented Mar 30, 2015 at 5:34
- 2 Without you showing the code that send the email it is impossible to answer the question. – Mark Kaplun Commented Mar 30, 2015 at 6:14
- Well, there is no code. I could not even start on it, or don't even know where to even start from. – Steve Kim Commented Mar 30, 2015 at 6:24
2 Answers
Reset to default 26If and when you are using wp_mail()
, then you can just set Reply-To
for the $headers
parameter. Exemplary usage below:
$to = "[email protected]";
$subject = "Using Reply-To with wp_mail";
$message = "This is an example for using Reply-To with wp_mail.";
$headers[] = 'Reply-To: Name Name <[email protected]>';
$attachments = array();
wp_mail( $to, $subject, $message, $headers, $attachments );
There is a hook wp_mail
hook too, which you could use to change the parameters.
In functions.php
// Function changes email that your site sending from
function change_my_from_address( $original_email_address ) {
return '[email protected]';
}
add_filter( 'wp_mail_from', 'change_my_from_address' );
// Change sender name
function change_my_sender_name( $original_email_from ) {
return 'example.pl';
}
add_filter( 'wp_mail_from_name', 'change_my_sender_name' );
本文标签: quotReplyto Addressquot Email
版权声明:本文标题:"Reply-to Address" Email 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742112433a2421314.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论