Skip to content

Commit

Permalink
fix: send email on withdraw approval and cancelled request (#350)
Browse files Browse the repository at this point in the history
  • Loading branch information
saimonh3 authored and sabbir1991 committed Aug 29, 2018
1 parent 38bfc74 commit d67e742
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions includes/api/class-withdraw-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,12 @@ public function change_withdraw_status( $request ) {
$withdraw->update_status( $request['id'], $user_id, $status_code );
$response = $wpdb->get_row( $sql );

if ( $status_code === 1 ) {
do_action( 'dokan_withdraw_request_approved', $user_id, $result->amount, $response->method );
} elseif ( $status_code === 2 ) {
do_action( 'dokan_withdraw_request_cancelled', $user_id, $result->amount, $response->method, $response->note );
}

return rest_ensure_response( $this->prepare_response_for_object( $response, $request ) );
}

Expand Down

0 comments on commit d67e742

Please sign in to comment.