Send Vendor packing slip and invoice on new order

WCMp PDF Invoice

Viewing 5 reply threads
  • Author
    • #129265
      Zia Rahim


      I bought the PDF invoice plugin but cannot find an option to email the vendor the packing slip and invoice. They are so busy, they cannot always login and check their dashboard.

      Can you provide some custom code I can add to the functions.php file to do this?

    • #129282

      Hello thank you for getting in touch with us, at present we don’t have any provision of sending invoice mail and packing slip mail to the vendors.
      As you can understand the flow you are looking for is itself a huge enhancement. Now generally we do help our user with code snippet but if that requires 10-12 lines of code. The flow you are looking for requires a good amount of custom code. If you have any developers, ask them to contact us so we can help you out with the coding procedure.
      Alternatively, you may hire our service team ( so they can add this feature in your site.

    • #129289
      Zia Rahim

      I am a dev.

      Here is some code I have. Can you help with a few edits to send the packing slip?

      function send_vendor_new_order_email($order_id) {

      $emails = WC()->mailer()->emails;
      $email_vendor = $emails[‘WC_Email_Vendor_New_Order’]->trigger($order_id);

      add_filter(‘woocommerce_order_status_processing’, ‘send_vendor_new_order_email’, 1, 2);

    • #129346

      Kindly add below code in the function.php of the current active theme :

      add_filter( 'woocommerce_email_attachments', 'attach_packingslip_to_email' , 999, 4 );
      function attach_packingslip_to_email( $attachments, $email_id, $order, $email = null ) {
          global $WCMp_PDF_Invoices;
          if ( !is_object( $order ) || !isset( $email_id ) ) {
              return $attachments;
          // Skip User emails
          if ( get_class( $order ) == 'WP_User' ) {
              return $attachments;
          if($email_id == 'vendor_new_order') {
              $attachments[] = $WCMp_PDF_Invoices->utils->get_pdf_attachments($order->get_id(), array('pdf_type' => 'packing_slip' ) );
          return $attachments;


    • #129385
      Zia Rahim

      Thank you very much, I will give it a try.

    • #129388

      your welcome , please let us know

Viewing 5 reply threads

The topic ‘Send Vendor packing slip and invoice on new order’ is closed to new replies.