*/ protected function input_properties(): array { return array( 'recipient' => array( 'type' => 'string', 'description' => __( 'Where to send the test message. Required, and never defaulted.', 'acrossai-abilities-manager' ) ), ); } /** * @since 0.0.34 * @return array */ protected function required_input(): array { return array( 'recipient' ); } /** * @since 0.0.34 * @return array */ protected function output_properties(): array { return array( 'recipient' => array( 'type' => 'string' ), 'mailer' => array( 'type' => 'string' ), 'accepted_by_mailer' => array( 'type' => 'boolean' ), 'domain_check_passed' => array( 'type' => 'boolean' ), 'proves_delivery' => array( 'type' => 'boolean' ), 'notes' => array( 'type' => 'array', 'items' => array( 'type' => 'string' ) ), ); } /** * @since 0.0.34 * @return array */ protected function annotations(): array { return array( 'readonly' => false, 'destructive' => false, 'idempotent' => false, ); } /** * @since 0.0.34 * @return bool */ protected function requires_confirmation(): bool { return true; } /** * @since 0.0.34 * @return string */ protected function confirmation_message(): string { return __( 'This delivers a real email to the address given, which will arrive in somebody inbox. Pass confirm: true to send it.', 'acrossai-abilities-manager' ); } /** * @since 0.0.34 * @param array $input Input. * @return array|WP_Error */ protected function run( array $input ) { return Email_Repository::send_test( (string) ( $input['recipient'] ?? '' ) ); } }