Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

bashy's avatar
Level 65

Command - Best option for reminder emails 2 weeks before due date column

Hi all,

I have a command that pulls out entries from the DB that will have a due date that's 2 weeks from current date. I'm able to send the reminder email etc but what I need some opinions on is the following;

Since the reminder emails are being sent 2 weeks before the due date, I need some way of not sending duplicate notifications. Is it a good idea to put another column to update after sending the reminder? Maybe reminder_sent boolean or reminder_at date?

0 likes
7 replies
jlrdw's avatar

Is it a good idea to put another column to update after sending the reminder?

Yes, that's what I recently did in an accounting app, but in my case I had a isprt (is printed) flag set to tinyint for a 0 or 1. And also thanks so much for all your help, it's members like you that helped me learn so much about laravel.

Ricardo's avatar
Ricardo
Best Answer
Level 48

@bashy you're running the command once per day, I suppose, I can not see why duplication will happen if you are filtering by equal to today plus two weeks.

I have three of this commands without any additional field.

bashy's avatar
Level 65

@jlrdw Good to see you about still! Enjoyed learning and giving advice :) Thanks for the feedback on that.

@Ricardo Yeah I guess it would be daily and you wouldn't get duplicates! Totally didn't think about that. Thanks!

1 like
bashy's avatar
Level 65

@Ricardo What time would you run it daily? If I run it just after midnight, it won't then catch any entries added that day that have a 2 week timeframe? Or am I thinking about it too much...

Ricardo's avatar

@bashy if the due date is datetime it can be run twice one at 11:30pm, for example, and the other one at 11:58pm;

if due date is date it will run a near as possible to midnight.

My two cents.

Please or to participate in this conversation.