mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-29 22:58:51 +01:00
refactor: migrate checkEmailConfig to TypeScript and update imports
This commit is contained in:
parent
ab4596206f
commit
550bf56077
8 changed files with 27 additions and 32 deletions
16
packages/api/src/utils/email.ts
Normal file
16
packages/api/src/utils/email.ts
Normal 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;
|
||||
}
|
||||
|
|
@ -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';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue