Temp send email auto without cron

This commit is contained in:
Vins 2024-04-05 07:50:25 +02:00
parent a125f3482c
commit 254b5cb374
2 changed files with 3 additions and 2 deletions

View File

@ -132,8 +132,9 @@ export default class EmailBuilder {
nbTrySend: null,
lastTrySendDate: null,
});
this.mailchimpService.sendEmails();
});
if(this.variables.ENV !== "dev") await this.mailchimpService.sendEmails();
}
}

View File

@ -52,7 +52,7 @@ export default class MailchimpService extends BaseService {
* @throws {Error} If email cannot be sent
*/
public async sendEmails() {
const emailsToSend = await this.get({ where: { sentAt: null } });
const emailsToSend = await this.get({ where: { sentAt: null } });
const currentDate = new Date();
let nextTrySendDate = null;