mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 08:13:56 +10:00
💬 ♻️ signed mail template
This commit is contained in:
@ -1,7 +1,16 @@
|
||||
import { ReadStream } from "fs";
|
||||
import nodemailer from "nodemailer";
|
||||
import nodemailerSendgrid from "nodemailer-sendgrid";
|
||||
|
||||
export const sendMail = async (to: string, subject: string, body: string) => {
|
||||
export const sendMail = async (
|
||||
to: string,
|
||||
subject: string,
|
||||
body: string,
|
||||
attachments: {
|
||||
filename: string;
|
||||
content: string | Buffer;
|
||||
}[] = []
|
||||
) => {
|
||||
if (!process.env.SENDGRID_API_KEY)
|
||||
throw new Error("Sendgrid API Key not set.");
|
||||
|
||||
@ -16,6 +25,7 @@ export const sendMail = async (to: string, subject: string, body: string) => {
|
||||
to: to,
|
||||
subject: subject,
|
||||
html: body,
|
||||
attachments: attachments,
|
||||
})
|
||||
.catch((err) => {
|
||||
throw err;
|
||||
|
||||
Reference in New Issue
Block a user