emailer update fixed so it can now send to multiple recipients

This commit is contained in:
Simon Pocrnjič
2025-10-15 23:46:44 +02:00
parent ddfc79ffe8
commit ed62311ba4
7 changed files with 172 additions and 28 deletions
@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::table('email_logs', function (Blueprint $table) {
if (Schema::hasColumn('email_logs', 'message_id')) {
$table->dropUnique(['message_id']);
$table->dropColumn('message_id');
}
// Make to_email nullable to allow blank when multiple recipients
$table->string('to_email')->nullable()->change();
});
}
public function down(): void
{
Schema::table('email_logs', function (Blueprint $table) {
// Recreate message_id as nullable unique if needed
if (! Schema::hasColumn('email_logs', 'message_id')) {
$table->string('message_id')->nullable()->unique();
}
// Revert to_email to not nullable
$table->string('to_email')->nullable(false)->change();
});
}
};