feat: added mailer env

This commit is contained in:
Sergey Yarkov 2022-06-05 23:04:15 +03:00
parent 5171f65429
commit 294a4f584d
2 changed files with 2 additions and 1 deletions

View File

@ -18,7 +18,7 @@ const mailConfig: MailConfig = {
| a mailer | a mailer
| |
*/ */
mailer: 'mailgun', mailer: Env.get('MAILER'),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------

1
env.ts
View File

@ -30,6 +30,7 @@ export default Env.rules({
REDIS_HOST: Env.schema.string({ format: 'host' }), REDIS_HOST: Env.schema.string({ format: 'host' }),
REDIS_PORT: Env.schema.number(), REDIS_PORT: Env.schema.number(),
REDIS_PASSWORD: Env.schema.string.optional(), REDIS_PASSWORD: Env.schema.string.optional(),
MAILER: Env.schema.enum(['mailgun', 'smtp'] as const),
SMTP_HOST: Env.schema.string({ format: 'host' }), SMTP_HOST: Env.schema.string({ format: 'host' }),
SMTP_PORT: Env.schema.number(), SMTP_PORT: Env.schema.number(),
SMTP_USERNAME: Env.schema.string(), SMTP_USERNAME: Env.schema.string(),