namespace, '/' . $this->rest_base . '/(?P[\d]+)/email', array( array( 'methods' => WP_REST_Server::CREATABLE, 'callback' => array( $this, 'wcpos_send_email' ), 'permission_callback' => array( $this, 'wcpos_send_email_permissions_check' ), 'args' => array_merge( $this->get_endpoint_args_for_item_schema( WP_REST_Server::CREATABLE ), array( 'email' => array( 'type' => 'string', 'description' => /* translators: REST API schema field label or error message. */ __( 'Email address', 'woocommerce-pos' ), 'required' => true, ), 'save_to' => array( 'type' => 'string', 'description' => __( 'Save email to order', 'woocommerce-pos' ), 'required' => false, ), ) ), ), 'schema' => array( $this, 'wcpos_get_public_send_email_schema' ), ) ); } }