Skip to content

Commit

Permalink
fix: send email to admin on adding a new product via REST API (#562)
Browse files Browse the repository at this point in the history
  • Loading branch information
saimonh3 authored and sabbir1991 committed Feb 25, 2019
1 parent bb3fc71 commit 4bde10e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions includes/api/class-api-rest-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ public function create_item( $request ) {

//Update post author
wp_update_post( array( 'ID' => $object->get_id(), 'post_author' => dokan_get_current_user_id() ) );

// send email to admin on adding a new product
do_action( 'dokan_new_product_added', $object->get_id(), $request );

return $this->prepare_data_for_response( $this->get_object( $object->get_id() ), $request );
} catch ( WC_Data_Exception $e ) {
return new WP_Error( $e->getErrorCode(), $e->getMessage(), $e->getErrorData() );
Expand Down

0 comments on commit 4bde10e

Please sign in to comment.