log email result and subject
This commit is contained in:
@@ -6,6 +6,7 @@ import { emailSchema } from '@/lib/validations/email.schema';
|
||||
import { renderDoctorSummaryReceivedEmail } from '@kit/email-templates';
|
||||
import { getMailer } from '@kit/mailers';
|
||||
import { enhanceAction } from '@kit/next/actions';
|
||||
import { getLogger } from '@kit/shared/logger';
|
||||
|
||||
export const sendDoctorSummaryCompletedEmail = async (
|
||||
language: string,
|
||||
@@ -49,12 +50,18 @@ export const sendCompanyOfferEmail = async (
|
||||
export const sendEmail = enhanceAction(
|
||||
async ({ subject, html, to }) => {
|
||||
const mailer = await getMailer();
|
||||
await mailer.sendEmail({
|
||||
const log = await getLogger();
|
||||
|
||||
const result = await mailer.sendEmail({
|
||||
to,
|
||||
subject,
|
||||
html,
|
||||
});
|
||||
|
||||
log.info(
|
||||
`Sent email with subject "${subject}", result: ${JSON.stringify(result)}`,
|
||||
);
|
||||
|
||||
return {};
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user