2
0

♻️ Add shared eslint config

This commit is contained in:
Baptiste Arnaud
2022-11-21 11:12:43 +01:00
parent e09adf5c64
commit 451ffbcacf
123 changed files with 1151 additions and 1523 deletions

View File

@ -0,0 +1,20 @@
import { createTransport, SendMailOptions } from 'nodemailer'
import { env } from 'utils'
export const sendEmail = (
props: Pick<SendMailOptions, 'to' | 'html' | 'subject'>
) => {
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: process.env.SMTP_FROM ?? env('SMTP_FROM'),
...props,
})
}