👷 Transpile components for better DX
This commit is contained in:
committed by
Baptiste Arnaud
parent
898367a33b
commit
c1dd4d403e
18
packages/utils/api/sendEmailNotification.ts
Normal file
18
packages/utils/api/sendEmailNotification.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import { createTransport, SendMailOptions } from 'nodemailer'
|
||||
import { env } from '../utils'
|
||||
|
||||
export const sendEmailNotification = (props: Omit<SendMailOptions, 'from'>) => {
|
||||
const transporter = createTransport({
|
||||
host: process.env.SMTP_HOST,
|
||||
port: Number(process.env.SMTP_PORT),
|
||||
auth: {
|
||||
user: process.env.SMTP_USERNAME,
|
||||
pass: process.env.SMTP_PASSWORD,
|
||||
},
|
||||
})
|
||||
|
||||
return transporter.sendMail({
|
||||
from: env('SMTP_FROM'),
|
||||
...props,
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user