How to Control Where Your WooCommerce PDF Invoices Are Sent
Content
One of the most common questions about the 'PDF Invoices & Packing Slips for WooCommerce' plugin is how to control exactly which email addresses receive the invoice PDF. Whether you want to send invoices to an accountant, prevent them from going to certain customers, or attach them to custom email notifications, this guide covers the primary methods available.
Understanding the Core Setting: "Attach To"
The most straightforward way to control invoice delivery is within the plugin's settings. Navigate to WooCommerce > PDF Invoices > Documents > Invoice > General. Here you will find the "Attach to" option.
This setting allows you to select the specific WooCommerce email notifications that will have the PDF invoice attached. For example, you can attach the invoice to the "Completed order" email sent to the customer, but disable it for the "New order" email sent to the admin. This is the simplest way to ensure invoices are only sent to the customer and not to your store's admin email.
Method 1: Using the Professional Extension's Order Notification
For more advanced scenarios, the 'PDF Invoices & Packing Slips for WooCommerce' team offers a Professional extension. A recurring solution mentioned in support threads is the Order Notification feature.
This feature is designed for situations like:
- Sending a copy of every invoice to an accountant's email address.
- Sending the invoice only to a secondary email address (like an employer), while the customer receives a standard confirmation without the PDF.
- Triggering invoice emails based on custom conditions, such as a value selected from a checkout field.
The Order Notification acts as a separate, customizable WooCommerce email that can be configured with its own triggers and recipient list, giving you granular control over invoice distribution.
Method 2: Custom Code Snippets (For Developers)
If you have PHP knowledge, you can use filters provided by the plugin to create highly customized logic for sending invoices. Common use cases solved with code include:
Preventing Invoices for Specific Users or Roles
To disable invoices for certain user roles (e.g., wholesale customers who receive monthly invoices), you can use the wpo_wcpdf_document_is_allowed filter. This allows you to check the user's role and prevent the invoice from being generated or sent.
Conditionally Attaching Invoices Based on Order Data
You can use the wpo_wcpdf_custom_attachment_condition filter to attach invoices based on specific order metadata. For instance, you could attach the invoice only if a certain shipping method is used, or if a custom checkbox (e.g., "I want an invoice") was selected during checkout. The filter passes the order object, allowing you to check for shipping methods, product IDs, or custom fields.
Attaching Invoices to Custom Email Notifications
If you have a custom email notification that doesn't appear in the standard "Attach to" list, the plugin may still detect it if it's built using the standard WooCommerce email class. If it doesn't appear, you can use shortcodes like [wcpdf_download_pdf] or [wcpdf_document_link] to manually insert a link to the PDF within the email's content.
Troubleshooting Common Issues
- Invoice not sending to a custom field email: If you've added code to send an invoice to an email address stored in a custom field, double-check that the meta key used in
get_meta()matches exactly the key used to save the field value. - "Send PDF invoice" option missing from order actions: Ensure that the invoice is set to attach to the "Order details (Manual email)" option in the plugin settings. This controls the visibility of the option in the dropdown.
- Invoice data not updating: The invoice is generated with the order data that existed at the time of creation. If a customer updates their address later, you may need to manually regenerate the invoice from the order admin screen for it to reflect the new information.
By combining the built-in settings with the advanced options from the Professional extension or custom code, you can achieve precise control over where and when your WooCommerce PDF invoices are sent.
Related Support Threads Support
-
Send invoice to store based on custom fieldhttps://wordpress.org/support/topic/send-invoice-to-store-based-on-custom-field/
-
Transporator invoice pdfhttps://wordpress.org/support/topic/transporator-invoice-pdf/
-
Disable invoice creation for particular emailshttps://wordpress.org/support/topic/disable-invoice-creation-for-particular-emails/
-
Adding additional emails to “send order email” drop downhttps://wordpress.org/support/topic/adding-additional-emails-to-send-order-email-drop-down/
-
How to invoice commission to the Dokan vendorhttps://wordpress.org/support/topic/how-to-invoice-commission-to-the-dokan-vendor/
-
Send pdf invoice automatically to accountanthttps://wordpress.org/support/topic/send-pdf-invoice-automatically-to-accountant/
-
Only send invoices for certain productshttps://wordpress.org/support/topic/only-send-invoices-for-certain-products/
-
Sent The Invoice Notification for custom mail addresshttps://wordpress.org/support/topic/sent-the-invoice-notification-for-custom-mail-address/
-
exclude email adres from pdf invoicehttps://wordpress.org/support/topic/exclude-email-adres-from-pdf-invoice/
-
Double email invoicehttps://wordpress.org/support/topic/double-email-invoice/
-
How do you attach the invoice to the outgoing new order email to the client?https://wordpress.org/support/topic/how-do-you-attach-the-invoice-to-the-outgoing-new-order-email-to-the-client/
-
Is it possible also send the email “order pending” to site owner?https://wordpress.org/support/topic/is-it-possible-also-send-the-email-order-pending-to-site-owner/
-
Automatic Attachment to WooCommerce Emailshttps://wordpress.org/support/topic/automatic-attachment-to-woocommerce-emails/
-
Send Invoice Only to Customer?https://wordpress.org/support/topic/send-invoice-only-to-customer/
-
How to update data after the order is completedhttps://wordpress.org/support/topic/how-to-update-data-after-the-order-is-completed/
-
Remove PDF invoice for custom email recipientshttps://wordpress.org/support/topic/remove-pdf-invoice-for-custom-email-recipients/
-
Programmatically send invoicehttps://wordpress.org/support/topic/programmatically-send-invoice/
-
Invoice send to multiple emailshttps://wordpress.org/support/topic/invoice-send-to-multiple-emails/
-
PDF Invoices to different emailhttps://wordpress.org/support/topic/pdf-invoices-to-different-email/
-
Send Invoice depending on radio selectionhttps://wordpress.org/support/topic/send-invoice-depending-on-radio-selection/
-
Mailchimp integrationhttps://wordpress.org/support/topic/mailchimp-integration-112/
-
create invoice and send mail, and various questionshttps://wordpress.org/support/topic/send-mail-7/
-
Feature Question: Send Invoices Manually only?https://wordpress.org/support/topic/feature-question-send-invoices-manually-only/
-
Send email to customer when updatedhttps://wordpress.org/support/topic/send-email-to-customer-when-updated/
-
Only send invoice to additional email addresshttps://wordpress.org/support/topic/only-send-invoice-to-additional-email-address/
-
Include invoice with order completed email for only certain shipping typeshttps://wordpress.org/support/topic/include-invoice-with-order-completed-email-for-only-certain-shipping-types/
-
Attach invoice to custom emailhttps://wordpress.org/support/topic/attach-invoice-to-custom-email/