<?php
/**
 * Early Email Delivery transport registration so wp_mail works before the module kernel boots.
 *
 * Loads only the transport stack (not Admin UI / Domain Health / importers).
 *
 * @package EmailSmtp
 * @since 1.0.1
 */

namespace EmailSmtp;

use EmailSmtp\Includes\MailInterceptor;
use WP_PowerSuite\Core\OptionStore;

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

if ( ! OptionStore::getInstance()->isModuleEnabled( 'email-smtp' ) ) {
	return;
}

$transport = __DIR__ . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'bootstrap-transport.php';
if ( is_readable( $transport ) ) {
	require_once $transport;
}

MailInterceptor::register();
