• Resolved rrodrigofranco

    (@rrodrigofranco)


    Hi there,

    I created a code to resend email to the seller. This code?

    dddd

    function 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)
  • Plugin Support Jahidul Hassan Mojumder

    (@jahidulhassan)

    Hi @rrodrigofranco,

    According to our support policy, we are unable to review a custom code done from a user’s end. Assisting with customizations and modifications takes extra time, which can divert our support engineer’s attention away from another customer who may be experiencing a more serious issue. And sometimes that customer can be you.

    Anyways, I am keeping this thread open so that anyone can contribute.

    Plugin Support sazdhossain

    (@sazdhossain)

    Hi?@rrodrigofranco,

    Due to a lack of activity, this subject is now considered resolved. If you have any further inquiries, please feel free to initiate a new discussion.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to resend email for the seller’ is closed to new replies.