<?php
/**
 * Custom Abandoned Cart email type.
 *
 * @package EDD\Pro\CartRecovery\Emails\Types
 * @copyright Copyright (c) 2026, Sandhills Development, LLC
 * @license https://opensource.org/licenses/GPL-2.0 GNU Public License
 * @since 3.6.5
 */

namespace EDD\Pro\CartRecovery\Emails\Types;

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

/**
 * Dynamically-created Abandoned Cart email type.
 *
 * Unlike the built-in ACR types (ImmediateRecovery, ValueReinforcement,
 * FinalAttempt) whose IDs are known at compile time, each custom email is a
 * user-created record stored in the EDD emails table. The email ID is
 * therefore injected via the constructor rather than hardcoded as a class
 * property.
 *
 * @since 3.6.5
 */
class Custom extends Base {

	/**
	 * Constructor.
	 *
	 * @since 3.6.5
	 * @param object $cart       Cart payload.
	 * @param array  $token_data Recovery token metadata.
	 * @param string $email_id   The registered email ID for this custom record.
	 */
	public function __construct( object $cart, array $token_data = array(), string $email_id = '' ) {
		parent::__construct( $cart, $token_data );
		$this->id = $email_id;
	}
}
