diff --git a/src/utils/worker/mail/index.ts b/src/utils/worker/mail/index.ts index 19aa6684f..e7bfea7fd 100644 --- a/src/utils/worker/mail/index.ts +++ b/src/utils/worker/mail/index.ts @@ -10,11 +10,14 @@ export interface SendMailProps { // TODO: https://github.com/taskany-inc/issues/issues/2330 // import { render } from '@react-email/render'; // const emailHtml = render(); -export const sendMail = ({ to, subject, text, html }: SendMailProps) => - mailServer.sendMail({ - from: `"Taskany Issues" <${process.env.MAIL_USER}>`, - to: to.join(', '), - subject, - text, - html, - }); +export const sendMail = ({ to, subject, text, html }: SendMailProps) => { + if (process.env.MAIL_USER && process.env.MAIL_PASS) { + return mailServer.sendMail({ + from: `"Taskany Issues" <${process.env.MAIL_USER}>`, + to: to.join(', '), + subject, + text, + html, + }); + } +};