<?php
declare(strict_types=1);

$configFile = __DIR__ . '/app_config.php';
$appConfig = is_file($configFile) ? (require $configFile) : [];
$mail = is_array($appConfig['mail'] ?? null) ? $appConfig['mail'] : [];

return [
    'enabled' => (bool)($mail['enabled'] ?? false),
    'host' => (string)($mail['host'] ?? ''),
    'username' => (string)($mail['username'] ?? ''),
    'password' => (string)($mail['password'] ?? ''),
    'port' => (int)($mail['port'] ?? 587),
    'encryption' => (string)($mail['encryption'] ?? 'tls'),
    'from_email' => (string)($mail['from_email'] ?? ''),
    'from_name' => (string)($mail['from_name'] ?? 'Електронний журнал'),
    'reply_to' => (string)($mail['reply_to'] ?? ''),
];
