BinarCode / laravel-mailator

Email scheduler for Laravel
MIT License
226 stars 12 forks source link

fix: calculate afterConstrain diff in minutes #2581

Open badcristian opened 8 months ago

badcristian commented 8 months ago

fixes #2575

this was used on line 47: $schedule->timestamp_target->diffInMinutes(now()->floorSeconds()) >= $schedule->delay_minutes

instead of this: $schedule->timestamp_target->diffInMinutes(now()->floorSeconds()) === $schedule->delay_minutes

because the second option will work only if mailator will be run every minute, which will probably not happen. So, for example, if the notification should be sent 10m after a target time and when the mailator is run we are more than 20m past it i think this should return true anyway.