Fix reminders

This commit is contained in:
Regis Freyd
2017-07-21 21:40:30 -04:00
parent ff497f121e
commit 2c2e72d6ca
4 changed files with 16 additions and 10 deletions
+3 -1
View File
@@ -54,6 +54,7 @@ class SendNotifications extends Command
$account = $reminder->contact->account;
$reminderDate = $reminder->next_expected_date->hour(0)->minute(0)->second(0)->toDateString();
$sendEmailToUser = false;
$userTimezone = null;
// check if one of the user of the account has the reminder on this day
foreach ($account->users as $user) {
@@ -61,6 +62,7 @@ class SendNotifications extends Command
if ($reminderDate === $userCurrentDate) {
$sendEmailToUser = true;
$userTimezone = $user->timezone;
}
}
@@ -69,7 +71,7 @@ class SendNotifications extends Command
dispatch(new SendReminderEmail($reminder, $user));
}
dispatch(new SetNextReminderDate($reminder));
dispatch(new SetNextReminderDate($reminder, $userTimezone));
}
}
}