Skip to content

Commit

Permalink
feat: flag for mailer
Browse files Browse the repository at this point in the history
  • Loading branch information
asabotovich committed Nov 18, 2024
1 parent 74328fe commit 2240f0b
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/utils/worker/mail/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(<Email url="https://example.com" />);
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,
});
}
};

0 comments on commit 2240f0b

Please sign in to comment.