I have this code in one of my controller's install method:
let reminderId = null;
F.on('settings.changed', (settings) => {
if (reminderId) {
F.clearSchedule(reminderId);
}
F.schedule(settings.reminderTime, '1 day', () => {
F.mail('my@email.com', 'Subject'); // <-- i send an email to my address
});
});
This should send an email to me every day, based on what I set in the settings. I put the F.emit('settings.changed') somewhere, where it would get called 500+ times a day (my mistake), I would receive 500 emails every day, even though I clear the schedule before registering it again.
I have this code in one of my controller's
install
method:This should send an email to me every day, based on what I set in the settings. I put the
F.emit('settings.changed')
somewhere, where it would get called 500+ times a day (my mistake), I would receive 500 emails every day, even though I clear the schedule before registering it again.