Compare commits

..

No commits in common. "cf77797512f9ae118d543779bd545680688ec28c" and "a9ecdfe4bbd3925538ed61125d108f4cb64cfcf0" have entirely different histories.

2 changed files with 8 additions and 3 deletions

View File

@ -23,14 +23,18 @@ class PreventionRememberAction
->orWhereNull('last_remembered_at') ->orWhereNull('last_remembered_at')
); );
foreach ($query->get() as $participant) { foreach ($query->get() as $participant) {
if ($participant->getFields()->getMailRecipient() === null || count($participant->preventions()) === 0) { if (count($participant->preventions()) === 0) {
continue; return;
} }
$body = app(PreventionSettings::class)->refresh()->formmail $body = app(PreventionSettings::class)->refresh()->formmail
->placeholder('formname', $participant->form->name) ->placeholder('formname', $participant->form->name)
->append($participant->form->prevention_text); ->append($participant->form->prevention_text);
if ($participant->getFields()->getMailRecipient() === null) {
continue;
}
Mail::send(new PreventionRememberMail($participant, $body)); Mail::send(new PreventionRememberMail($participant, $body));
$participant->update(['last_remembered_at' => now()]); $participant->update(['last_remembered_at' => now()]);

View File

@ -3,6 +3,7 @@
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
use Tests\RequestFactories\EditorRequestFactory;
return new class extends Migration return new class extends Migration
{ {
@ -14,7 +15,7 @@ return new class extends Migration
public function up() public function up()
{ {
Schema::table('forms', function (Blueprint $table) { Schema::table('forms', function (Blueprint $table) {
$table->json('prevention_text')->after('description')->default(json_encode(['time' => 4, 'blocks' => [], 'version' => '1.0'])); $table->json('prevention_text')->after('description')->default(json_encode(EditorRequestFactory::new()->empty()->create()));
}); });
} }