What I need is :
I need to send transactional e-mails from two SMTP configurations.
All WooCommerce side of e-mails should send from [email protected]. Example: order summary, delivery status.
All WordPress user side of e-mails should send from [email protected]. Example: Forget password e-mail, account creation e-mail.
Note: All methods are working. I just want to send different e-mails from their respective purpose.
What I need is :
I need to send transactional e-mails from two SMTP configurations.
All WooCommerce side of e-mails should send from [email protected]. Example: order summary, delivery status.
All WordPress user side of e-mails should send from [email protected]. Example: Forget password e-mail, account creation e-mail.
Note: All methods are working. I just want to send different e-mails from their respective purpose.
Share Improve this question edited Jul 3, 2019 at 1:07 user3135691 1,0359 silver badges15 bronze badges asked Jul 1, 2019 at 14:56 VarunaVaruna 133 bronze badges 2- Are you really sending from two different domains i.e maydomain and mydomain? If it’s a typo you should update your question title, because you’re not trying to configure two SMTP servers, but rather two From addresses which is a lot simpler – Andy Commented Jul 2, 2019 at 19:41
- @Andy that was a typo. Sorry about that. But this not about from addresses. Same domain but I have two SMTP servers (main smtp server and marketing smtp server. Marketing smtp server is optimized send bulk emails) – Varuna Commented Jul 5, 2019 at 10:08
1 Answer
Reset to default 1Disclaimer: this is clumsy, someone might have a better suggestion. But here's one idea:
- Leave WordPress configured with your [email protected] settings.
- Set up Woo with the [email protected] address (WooCommerce -> Settings -> Emails -> From Address).
- Hook woocommerce_mail_callback with your own function that temporarily hooks phpmailer_init to change the SMTP configuration before calling wp_mail.
Or perhaps you can skip step 3 if your SMTP server can be configured to allow an alternate "from" address for authenticated users.
And just a heads up: WooCommerce supplies its own forgot password and new account emails, so you'd need to decide whether you want to return those to their WordPress defaults, or just change them as well in step 3.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745350231a4623789.html
评论列表(0条)