每个类别的自定义Woocommerce电子邮件模板

时间:2020-01-23 13:59:03

标签: php wordpress woocommerce

我已将电子邮件模板文件的副本复制到主题文件夹中:

$smtp = fsockopen( "tcp://mail.noris.net", 25, $errno, $errstr );
fread( $smtp, 512 );
fwrite($smtp,"EHLO test.de\r\n");
fread($smtp, 512);
fwrite($smtp,"STARTTLS\r\n");
fread($smtp, 512);
stream_set_blocking($smtp, true);
stream_context_set_option($smtp, 'ssl', 'verify_host', false);
stream_context_set_option($smtp, 'ssl', 'verify_peer', false);
stream_context_set_option($smtp, 'ssl', 'allow_self_signed', false);

//Self signed certificates are blocked by googl and most servers

stream_context_set_option($smtp, 'ssl', 'cafile', '/etc/ssl/cert.pem');
//you need to add correct and full path of CA file

//This is second solution in php documents in the link in question and in my answer
$secure = stream_socket_enable_crypto($smtp, true, STREAM_CRYPTO_METHOD_TLS_CLIENT);
stream_set_blocking($smtp, false);
print_r(stream_context_get_options($smtp));
if( ! $secure) {
    print("failed to connect securely\n");
}
else {
    print "Success!\n";
}

var_dump($errno);
var_dump($errstr);
die;

然后,我将此文件更改为:

$ php ssl_test.php
Array
(
    [ssl] => Array
        (
            [verify_host] =>
            [verify_peer] =>
            [allow_self_signed] =>
            [cafile] => /etc/ssl/cert.pem
        )

)
Success!
int(0)
string(0) ""

如您所见,我想将此自定义模板用于“ 65”类别中的产品。 但是订单无法处理,并返回服务器错误。 我在这里犯错了吗?

0 个答案:

没有答案