Setting up 2 SMTP accounts: 1 for wordpress and 1 for woocommerce
I wish to set up 2 smtp accounts on my wordpress site:
1 for woocommerce orders 1 for all other forms
i have the following code, but i am having trouble filtering the woocommmerce order. I am missing somthing. Here is the code:
add_action( 'phpmailer_init', 'send_smtp' );
function send_smtp( $phpmailer ) {
if ( true === 'WC_Email' )
{
$phpmailer-Host = SMTP_WC_HOST;
$phpmailer-SMTPAuth = SMTP_WC_AUTH;
$phpmailer-Port = SMTP_WC_PORT;
$phpmailer-Username = SMTP_WC_USER;
$phpmailer-Password = SMTP_WC_PASS;
$phpmailer-SMTPSecure = SMTP_WC_SECURE;
$phpmailer-From = SMTP_WC_FROM;
$phpmailer-FromName = SMTP_WC_NAME;
}
else{
$phpmailer-Host = SMTP_HOST;
$phpmailer-SMTPAuth = SMTP_AUTH;
$phpmailer-Port = SMTP_PORT;
$phpmailer-Username = SMTP_USER;
$phpmailer-Password = SMTP_PASS;
$phpmailer-SMTPSecure = SMTP_SECURE;
$phpmailer-From = SMTP_FROM;
$phpmailer-FromName = SMTP_NAME;
}
}
The results, both in woocommerce and regular forms result in the 'else' ; therefore, i'm not filtering the woocommerce orders correctly.