• Hello I am after some help please.
    I am looking for a code snippet in order to attach the PDF invoices to an automated email for a custom order status I have created. I have setup a custom order status (called ‘invoice due’) that triggers an email (called ‘overdue payment’), however the pdf does not attach. The snippet could be made to attach the pdf invoice to all status emails if that is easier. The PDF invoice currently attaches to the order completed email, however the custom status email uses a different template (woocommerce-order-status-manager/templates/emails/customer-order-status-email.php) which doesn’t automatically attach the pdf file. Any ideas?

    TIA
    Andy

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    For plugin specific advice I recommend asking in that plugin’s dedicated support forum.
    https://www.ads-software.com/support/plugin/custom-order-statuses-woocommerce/

    Assuming the plugin uses the wp_mail() function, you’d need access to the function’s $attachments argument to be able to send attachments. If that’s not possible through hooks provided by the plugin, you could use the “wp_mail” filter to modify the $attachments argument directly. All WP emails go through this filter, so you’d need to watch for some unique property within the passed data to identify the specific email you’re targeting. The passed data would also need to have enough information in order to be able to choose which file should be attached.

Viewing 1 replies (of 1 total)
  • The topic ‘Attach PDF invoice to custom order status email’ is closed to new replies.