• Resolved ito89

    (@ito89)


    Hello!
    How I can send via email (in link or attached), the pdf generated in an order (with order id), When status of the order id COMPLETED?
    I need a php code something like this.. buy I cant advance more.

    if( $order->has_status( ‘completed’ ) ) {
    $order = wc_get_order( $order_id );
    $customemail= “custom@gmail.com”;

    /*PHP CODE OF THE PLUGIN TO SEND THE PDF knowing the order id*/

    $mail = @mail($to, $subject, $message, $headers, $returnpath);
    }

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

    (@yordansoares)

    Hi @ito89,

    You can do this from the plugin settings, no need for any PHP code. Just go to WooCommerce > PDF Invoices > Documents > Invoices, find the Attach to setting, and check the Completed order option, to send the invoices attached to this email notification that is triggered when the order reaches the Completed status.

    Thread Starter ito89

    (@ito89)

    Hello!

    I knew this option, but I need to send It to a custom email (associated with the order, It is product supplier email), not for the customer.

    For this reason I need to customize. The Code I try is for functions.php, maybe some clues to do It this way or maybe there is a file in the plugin I can modify.

    Any idea?

    Thanks!

    • This reply was modified 2 years, 7 months ago by ito89.
    Plugin Contributor Yordan Soares

    (@yordansoares)

    Thanks for providing more details.

    This can be done already with the Professional extension, that includes a new WooCommerce email notification for this purpose: Order Notification. See Configuring the Order Notification email to learn more.

    Since WordPress doesn’t allow using these forums to provide premium support or answer pre-sale questions, if you have further inquiries about it, please write us by support@wpovernight.com

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Send INVOICE in email after status COMPLETED’ is closed to new replies.