<?php
/**
 * Emails Sent Tile
 *
 * @package     EDD\Pro\CartRecovery\Admin\Reports\Endpoints\Tiles
 * @copyright   Copyright (c) 2026, Sandhills Development, LLC
 * @license     https://opensource.org/licenses/gpl-2.0.php GNU Public License
 * @since       3.6.5
 */

namespace EDD\Pro\CartRecovery\Admin\Reports\Endpoints\Tiles;

// Exit if accessed directly.
defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore

use EDD\Reports\Endpoints\Tiles\Tile;

/**
 * Emails Sent Tile class.
 *
 * Displays the number of recovery emails sent in the selected date range.
 *
 * @since 3.6.5
 */
class EmailsSent extends Tile {
	use Traits\Emails;

	/**
	 * Gets the tile endpoint ID.
	 *
	 * @since 3.6.5
	 * @return string
	 */
	protected function get_id(): string {
		return 'acr_emails_sent';
	}

	/**
	 * Gets the tile label for display.
	 *
	 * @since 3.6.5
	 * @return string
	 */
	protected function get_label(): string {
		return __( 'Emails Sent', 'easy-digital-downloads' );
	}

	/**
	 * Gets the tooltip content for the tile.
	 *
	 * @since 3.6.5
	 * @return string
	 */
	protected function get_tooltip(): string {
		return __( 'Total recovery emails sent to customers.', 'easy-digital-downloads' );
	}

	/**
	 * Gets the number of emails sent in the selected date range.
	 *
	 * @since 3.6.5
	 * @return int
	 */
	protected function get_data(): int {
		$stats = $this->get_email_stats();
		return $stats['sent'];
	}
}
