import { Logger } from '../../../src/index.js';
export async function registerSmtpMailDriver(registry) {
    const core = (await importCore());
    if (core.SmtpDriver === undefined) {
        Logger.warn('[SmtpDriver] Failed to import core SmtpDriver');
        return;
    }
    const driver = core.SmtpDriver;
    if (driver === undefined)
        return;
    registry.register('smtp', (config, message) => driver.send(config, message));
}
const importCore = async () => {
    try {
        return await import('../../../src/index.js');
    }
    catch {
        try {
            return await import('../../../src/index.js');
        }
        catch {
            return {};
        }
    }
};
const core = (await importCore());
if (core.MailDriverRegistry !== undefined) {
    await registerSmtpMailDriver(core.MailDriverRegistry);
}
