Vigyata.AI
Is this your channel?

Episode 4 - Automatically Sending Reminder Emails - Cron Jobs

538 views· 26 likes· 16:05· May 25, 2025

🛍️ Products Mentioned (5)

In this video, we create a send-reminder-mail command in Laravel 12 to email users about their pending tasks. We schedule it using the new routes/console.php feature and run it daily with a Cloudways cron job. 💡 Powered by Cloudways – Managed Web Hosting for the Ultimate Online Presence === OFFER === GET 15% DISCOUNT ON ALL PLANS OF CLOUDWAYS HOSTING FOR 3 MONTHS https://bit.ly/43wmhuW === Important Links === Fonts, extensions I use, and Support Laratips links: https://unified.cloudways.com/signup?id=1029148&coupon=LARATIPS&data1=LARA5&utm_content=LARA5&utm_source=YouTube === Video Related Links === 👉 Project GitHub Link https://github.com/AshishDhamalaAD/todoapp 👉 Watch the full playlist: Not Just Another Todo App https://www.youtube.com/playlist?list=PL2DahmvUpeutVEyDcVzAMVH7NLSNy6lrS 👉 Laravel Documentation for sending Mail https://laravel.com/docs/12.x/mail 👉 Laravel Documentation for Task Scheduling https://laravel.com/docs/12.x/scheduling #laravel #php #laraveltip #laratips

About This Video

Hey, what’s up guys—welcome to Lara Tips. In this episode, I’m setting up automatic reminder emails for our Laravel 12 todo app using cron jobs. The goal is simple: for todos that have a reminder date set for today (start of day to end of day), are not completed, and haven’t been reminded yet, I send an email to the user automatically. Along the way, I also fix a small UI bug where the edit page was still saying “create todo,” and I sort the list by the latest reminder date so it’s easier to verify what’s happening. I build this feature the Laravel way: I create an Artisan command in the new routes/console.php, then move the actual logic into an invokable action class (SendReminderMailsAction) inside a domain-style folder. From there, I generate a Markdown Mailable, pass the todo into the email view, and test everything using Mailtrap SMTP so I can see the emails instantly without sending real mail. Finally, I show how to schedule the command daily (for example at 1 AM) and how to set up the cron job in Cloudways so Laravel’s scheduler actually runs on the server. In the next episode, I’ll speed this up properly with queues because sending a lot of emails synchronously is slow.

Frequently Asked Questions

🎬 More from Laratips