mirror of
https://github.com/lukevella/rallly.git
synced 2025-07-19 09:18:01 +02:00
🪵 Log error message from failed email (#693)
This commit is contained in:
parent
1bc749e17a
commit
43757becc6
1 changed files with 1 additions and 4 deletions
|
@ -81,7 +81,6 @@ type SendEmailOptions<T extends TemplateName> = {
|
||||||
to: string;
|
to: string;
|
||||||
subject: string;
|
subject: string;
|
||||||
props: TemplateProps<T>;
|
props: TemplateProps<T>;
|
||||||
onError?: () => void;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const sendEmail = async <T extends TemplateName>(
|
export const sendEmail = async <T extends TemplateName>(
|
||||||
|
@ -107,10 +106,8 @@ export const sendEmail = async <T extends TemplateName>(
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
html,
|
html,
|
||||||
});
|
});
|
||||||
return;
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("Error sending email", templateName, e);
|
console.error("Error sending email", templateName, e);
|
||||||
options.onError?.();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -120,6 +117,6 @@ export const sendRawEmail = async (options: Mail.Options) => {
|
||||||
await transport.sendMail(options);
|
await transport.sendMail(options);
|
||||||
return;
|
return;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("Error sending email");
|
console.error("Error sending email", e);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue