<?php
/**
 * Early SMTP transport registration so wp_mail works before the module kernel boots.
 *
 * @package EmailSmtp
 * @since 1.0.1
 */

namespace EmailSmtp;

use WP_PowerSuite\Core\OptionStore;

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

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

$module_file = __DIR__ . DIRECTORY_SEPARATOR . 'module.php';
if ( is_readable( $module_file ) ) {
	require_once $module_file;
}

Module::registerPhpMailerHook();
