emailer update fixed so it can now send to multiple recipients
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use App\Models\EmailLog;
|
||||
use App\Models\EmailLogStatus;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
|
||||
it('persists to_recipients array when filling and saving', function () {
|
||||
$log = new EmailLog();
|
||||
$log->fill([
|
||||
'uuid' => (string) Str::uuid(),
|
||||
'to_email' => 'first@example.com',
|
||||
'to_recipients' => ['first@example.com', 'second@example.com'],
|
||||
'subject' => 'Test Subject',
|
||||
'status' => EmailLogStatus::Queued,
|
||||
'queued_at' => now(),
|
||||
]);
|
||||
|
||||
$log->save();
|
||||
|
||||
$fresh = EmailLog::query()->findOrFail($log->id);
|
||||
expect($fresh->to_recipients)
|
||||
->toBeArray()
|
||||
->and($fresh->to_recipients)
|
||||
->toContain('first@example.com', 'second@example.com');
|
||||
});
|
||||
Reference in New Issue
Block a user