complete story 8.8 with qa tests
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Mail;
|
||||
|
||||
use App\Models\TimelineUpdate;
|
||||
use Illuminate\Mail\Mailables\Content;
|
||||
use Illuminate\Mail\Mailables\Envelope;
|
||||
|
||||
class TimelineUpdateEmail extends BaseMailable
|
||||
{
|
||||
public function __construct(
|
||||
public TimelineUpdate $update
|
||||
) {
|
||||
$this->locale = $this->update->timeline->user->preferred_language ?? 'ar';
|
||||
}
|
||||
|
||||
public function envelope(): Envelope
|
||||
{
|
||||
$caseName = $this->update->timeline->case_name;
|
||||
|
||||
$subject = $this->locale === 'ar'
|
||||
? "تحديث على قضيتك: {$caseName}"
|
||||
: "Update on your case: {$caseName}";
|
||||
|
||||
return new Envelope(
|
||||
subject: $subject,
|
||||
);
|
||||
}
|
||||
|
||||
public function content(): Content
|
||||
{
|
||||
return new Content(
|
||||
markdown: "emails.timeline.update.{$this->locale}",
|
||||
with: [
|
||||
'update' => $this->update,
|
||||
'timeline' => $this->update->timeline,
|
||||
'user' => $this->update->timeline->user,
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user