Compare commits

...

3 Commits

Author SHA1 Message Date
philipp lang cf77797512 Fix PreventionRememberAction
continuous-integration/drone/tag Build is passing Details
continuous-integration/drone/push Build is passing Details
2024-07-10 00:52:05 +02:00
philipp lang d44ad4bc53 Fix migration
continuous-integration/drone/tag Build is passing Details
2024-07-10 00:19:29 +02:00
philipp lang 94597e57c1 Fix migration
continuous-integration/drone/tag Build was killed Details
2024-07-10 00:18:18 +02:00
2 changed files with 3 additions and 8 deletions

View File

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

View File

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