$this->id, 'recipient_email' => $this->recipient_email, 'recipient_name' => $this->recipient_name, 'template_type' => $this->template_type->value, 'template_label' => $this->template_type->label(), 'subject' => $this->subject, 'status' => $this->status->value, 'error_message' => $this->error_message, 'queued_at' => $this->queued_at?->toIso8601String(), 'sent_at' => $this->sent_at?->toIso8601String(), 'failed_at' => $this->failed_at?->toIso8601String(), 'triggered_by' => $this->whenLoaded('triggeredBy', fn () => [ 'id' => $this->triggeredBy->id, 'name' => $this->triggeredBy->first_name . ' ' . $this->triggeredBy->last_name, ]), 'event_id' => $this->event_id, 'person_id' => $this->person_id, 'created_at' => $this->created_at->toIso8601String(), ]; } }