fix: No-op sending emails in self-hosted if configuration is unavailable rather than retrying

towards #7982
This commit is contained in:
Tom Moor committed 2024-11-19 23:00:09 -05:00
1 parent 64c7a89e4d
commit 90efd707d9
1 file changed
+9
+9
View File
@@ -51,6 +51,15 @@ export default abstract class BaseEmail<
* @returns A promise that resolves once the email is placed on the task queue
*/
public schedule(options?: Bull.JobOptions) {
// No-op to schedule emails if SMTP is not configured
if (!env.SMTP_FROM_EMAIL) {
Logger.info(
"email",
`Email ${this.constructor.name} not sent due to missing SMTP configuration`
);
return;
}
const templateName = this.constructor.name;
Metrics.increment("email.scheduled", {