How to resend email for the seller
-
Hi there,
I created a code to resend email to the seller. This code?
ddddfunction resend_payment_completed_email() { $url = $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; if ( isset( $_GET['order_id'] ) && absint( $_GET['order_id'] ) && strpos($url,'video-gravado') === false) { $order_id = absint( $_GET['order_id'] ); $order = wc_get_order( $order_id ); if ( $order && 'completed' === $order->get_status() ) { // Get the email class instance $email_class = WC()->mailer()->get_emails()['WC_Email_Customer_Completed_Order']; // Send the email $email_class->trigger( $order_id ); // Send the email to seller $vendor_id = get_post_meta( $order_id, '_dokan_vendor_id', true ); if ( $vendor_id ) { $seller_email = dokan()->vendor->get( $vendor_id )->get_email(); if ( $seller_email ) { $email_class->trigger( $order_id, $seller_email ); } } echo "<script>alert('Seu pedido foi reenviado com sucesso!')</script>"; // Output a success message echo "<script>window.close()</script>"; exit; } } } add_action( 'wp_loaded', 'resend_payment_completed_email' );
However this code do not sending the email to the seller. Someone can help me?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How to resend email for the seller’ is closed to new replies.