mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-20 02:10:15 +01:00
17 lines
530 B
TypeScript
17 lines
530 B
TypeScript
|
|
/**
|
||
|
|
* 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;
|
||
|
|
}
|