diff --git a/server/email/sendemail.js b/server/email/sendemail.js index 878918f48..65b5a60ce 100644 --- a/server/email/sendemail.js +++ b/server/email/sendemail.js @@ -110,7 +110,7 @@ const sendProManagerWelcomeEmail = async (to, subject, html) => { } }; -const sendTaskEmail = async ({ to, subject, text, attachments }) => { +const sendTaskEmail = async ({ to, subject, type = "text", html, text, attachments }) => { try { transporter.sendMail( { @@ -121,7 +121,7 @@ const sendTaskEmail = async ({ to, subject, text, attachments }) => { }), to: to, subject: subject, - text: text, + ...(type === "text" ? { text } : { html }), attachments: attachments || null }, (err, info) => {