Added shared mailer package to remove circular dependencies between packages. (#63)

This commit is contained in:
Giancarlo Buomprisco
2024-09-04 03:34:48 +08:00
committed by GitHub
parent d18f810c6e
commit 4c7a3354b9
21 changed files with 256 additions and 38 deletions

View File

@@ -0,0 +1,21 @@
import { SmtpConfigSchema } from '@kit/mailers-shared';
export function getSMTPConfiguration() {
const data = SmtpConfigSchema.parse({
user: process.env.EMAIL_USER,
pass: process.env.EMAIL_PASSWORD,
host: process.env.EMAIL_HOST,
port: Number(process.env.EMAIL_PORT),
secure: process.env.EMAIL_TLS !== 'false',
});
return {
host: data.host,
port: data.port,
secure: data.secure,
auth: {
user: data.user,
pass: data.pass,
},
};
}