Add inactivity reminder emails
No app/Notifications existed beyond Laravel's stock email verification and password reset - nothing brought lapsed users back. Adds a queued InactivityReminder mail notification and a scheduled command (app:send-inactivity-reminders, daily at 09:00) that emails verified users with no completed workout session in the last 5 days, at most once per 7-day cooldown so it can't spam. Skips brand-new signups so it doesn't nag someone who registered an hour ago. Verified the full pipeline live: scheduled command queues the notification (QUEUE_CONNECTION=database), a queue worker processes it, and the rendered email lands in the log driver with a working link back to /workouts. Production still needs cron actually invoking `php artisan schedule:run` every minute and a running queue worker - that's part of the pending deployment setup, not something this change can provide on its own. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->timestamp('last_reminder_sent_at')->nullable()->after('minutes_per_session');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->dropColumn('last_reminder_sent_at');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user