feat: ✨ Add collaboration
This commit is contained in:
27
apps/builder/services/api/emails.ts
Normal file
27
apps/builder/services/api/emails.ts
Normal file
@ -0,0 +1,27 @@
|
||||
import { createTransport } from 'nodemailer'
|
||||
|
||||
export const sendEmailNotification = ({
|
||||
to,
|
||||
subject,
|
||||
content,
|
||||
}: {
|
||||
to: string
|
||||
subject: string
|
||||
content: string
|
||||
}) => {
|
||||
const transporter = createTransport({
|
||||
host: process.env.AUTH_EMAIL_SERVER_HOST,
|
||||
port: Number(process.env.AUTH_EMAIL_SERVER_PORT),
|
||||
auth: {
|
||||
user: process.env.AUTH_EMAIL_SERVER_USER,
|
||||
pass: process.env.AUTH_EMAIL_SERVER_PASSWORD,
|
||||
},
|
||||
})
|
||||
|
||||
return transporter.sendMail({
|
||||
from: `"${process.env.AUTH_EMAIL_FROM_NAME}" <${process.env.AUTH_EMAIL_FROM_EMAIL}>`,
|
||||
to,
|
||||
subject,
|
||||
html: content,
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user