Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @rodricus,

    Did you create that custom email using the WC email class?

    If so, you should be able to select it under WooCommerce?> PDF Invoices?>Documents?>Invoice?>Attach to setting.

    Thread Starter rodricus

    (@rodricus)

    Hello Yordan,

    I used the wp_mail function.

    Plugin Contributor Yordan Soares

    (@yordansoares)

    I see. Please note that last week we introduced a new function in our development environment (here:?PR#711) that should be available in the next public release:?wcpdf_get_document_file

    An easier approach, IMHO, would be to send a copy of the New order email to that third party email address. See: Receive a copy of each invoice sent by email.

    Thread Starter rodricus

    (@rodricus)

    Hello Yordan,

    The Invoice PDF is currently off for the Processing order email (its not marked at “WooCommerce > PDF Invoices >Documents >Invoice >Attach to”). So it’s logical it will not send an invoice PDF to the third party if I configure it through https://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/receive-a-copy-of-each-invoice-sent-by-email/

    Should I wait for the next public release? When will it be released?

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Do you always create the PDF invoices when the order is placed? If so, you could use the approach I mentioned above with the “New admin” email instead (you should have to mark this option within the Attach to setting).

    You still need to limit this behavior to the product category you mentioned, but I think I can offer more advice on this, if you confirm that sending the email to the “New admin” email would work.

    Thread Starter rodricus

    (@rodricus)

    You mean attach to “New order (Admin email)” ?

    I can confirm that sending an email and the invoice with “New order (Admin email)” is working. But my client has turned “New order (Admin email)” off, so I am not sure if I can just enable this option again.

    The only alternative is waiting for the new function for the next public release?

    Plugin Contributor Yordan Soares

    (@yordansoares)

    You mean attach to “New order (Admin email)” ? I can confirm that sending an email and the invoice with “New order (Admin email)” is working. But my client has turned “New order (Admin email)” off, so I am not sure if I can just enable this option again.

    Yes, I was referring to the “New order (Admin email)”. If your client does not want to receive a new email when the order is placed, maybe you have to follow my suggestion below.

    The only alternative is waiting for the new function for the next public release?

    You could try the Order Notification, included in the Professional extension. This custom WooCommerce notification is compatible with the document attachments, can be triggered when the order is placed, and offers a placeholder to fill the recipient field with the customer email address, which I think are the 3 main conditions you are looking for, right?

    See: Configuring the Order Notification email.

    • This reply was modified 1 year, 1 month ago by Yordan Soares. Reason: Added answer to the first question
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Programmatically send invoice’ is closed to new replies.