<?php

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

function emailking_add_email_send_api() {
	$perms = array( array( 'manage_smtp', EMAILKING_SCOPE_EMAIL ) );

	emailking( 'api' )->add(
		EMAILKING_SCOPE_EMAIL,
		array(
			'key'      => 'send_email',
			'title'    => 'Send email',
			'desc'     => 'Manually send email.',
			'perms'    => $perms,
			'callback' => array( \EmailKing\Send::class, 'send' ),
		)
	);
}

add_action( 'emailking_init_api', 'emailking_add_email_send_api' );
