<?php
/**
 * Minimal includes required to intercept and send mail (early bootstrap path).
 *
 * @package EmailSmtp
 * @since 1.10.39
 */

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

$includes = [
	'DeliveryResult.php',
	'DeliveryAttemptContext.php',
	'ErrorNormalizer.php',
	'EmailMessage.php',
	'ProviderInterface.php',
	'ConnectionStore.php',
	'AbstractProvider.php',
	'AbstractApiProvider.php',
	'ApiHttpClient.php',
	'AwsSigV4.php',
	'CredentialManager.php',
	'SettingsMigrator.php',
	'SettingsSchema.php',
	'ProviderRegistry.php',
	'EmailRouter.php',
	'MailInterceptor.php',
	'SmtpSettingsHelper.php',
	'SmtpRelayProfiles.php',
	'DeliveryOrchestrator.php',
	'FailureNotifier.php',
];

$dir = __DIR__ . DIRECTORY_SEPARATOR;
foreach ( $includes as $file ) {
	$path = $dir . $file;
	if ( is_readable( $path ) ) {
		require_once $path;
	}
}

// Core providers used by early bootstrap / migration. API/OAuth providers load lazily via registry.
require_once dirname( __DIR__ ) . '/providers/wordpress/Provider.php';
require_once dirname( __DIR__ ) . '/providers/smtp/Provider.php';
