refactor: migrate checkEmailConfig to TypeScript and update imports

This commit is contained in:
Danny Avila 2025-08-20 01:07:31 -04:00
parent ab4596206f
commit 550bf56077
No known key found for this signature in database
GPG key ID: BF31EEB2C5CA0956
8 changed files with 27 additions and 32 deletions

View file

@ -0,0 +1,16 @@
/**
* Check if email configuration is set
* @returns Returns `true` if either Mailgun or SMTP is properly configured
*/
export function checkEmailConfig(): boolean {
const hasMailgunConfig =
!!process.env.MAILGUN_API_KEY && !!process.env.MAILGUN_DOMAIN && !!process.env.EMAIL_FROM;
const hasSMTPConfig =
(!!process.env.EMAIL_SERVICE || !!process.env.EMAIL_HOST) &&
!!process.env.EMAIL_USERNAME &&
!!process.env.EMAIL_PASSWORD &&
!!process.env.EMAIL_FROM;
return hasMailgunConfig || hasSMTPConfig;
}

View file

@ -1,6 +1,7 @@
export * from './axios';
export * from './azure';
export * from './common';
export * from './email';
export * from './env';
export * from './events';
export * from './files';