I have a custom WooCommerce email that needs to send to the third party.
In this email, I have to add an attachment. I tried with wc_mail()
but the attachment not attached.
Here is how it look likes:
$attachment = array();
ob_start();
include('some-html-email-content.php');
$message = ob_get_clean();
$attachment[] = get_template_directory() . '/some.pdf';
wc_mail('xxx@example.com', 'some subject ', $message, "Content-Type: text/html\r\n", $attachment);
I can receive the email without any problem, only the attachment is not there. What did I done wrong?
I can't use woocommerce_email_attachments
filter hook, because this mail isn't attached to any regular woocommerce mail (new order, process, new user etc....).
I also tried with wp_mail()
still I cannot make it through.