$this->customer->lastname, 'firstname' => $this->customer->firstname ]), ); } /** * Get the message content definition. * * @return \Illuminate\Mail\Mailables\Content */ public function content(): \Illuminate\Mail\Mailables\Content { $participation = []; if (!is_null($this->unique_code)) { $participation = [ trans('Code Unique : :code', ['code' => $this->unique_code]), ]; } if (!is_null($this->ean_code)) { $participation[] = trans('Code EAN : :code', ['code' => $this->ean_code]); } return new Content( htmlString: (new MailMessage()) ->greeting(trans('Bonjour,')) ->line(trans( 'Vous trouverez en PJ les preuves de gain du joueur suivant :', ))->lines([ trans('Lot :'), "{$this->prize_label}", ])->lines([ trans('Gagnant :'), "{$this->customer->lastname} {$this->customer->firstname}", "{$this->customer->address}", "{$this->customer->address2}", "{$this->customer->postcode} {$this->customer->city} - {$this->customer->country->label()}", "{$this->customer->email}", "{$this->customer->phone}", ])->lines($participation)->render() ); } /** * Get the attachments for the message. * * @return array */ public function attachments(): array { return collect([$this->sticker, $this->ticket, $this->barcode]) ->filter() ->map(fn (string $file) => Attachment::fromPath( FileStorageHelper::getFileFullPath($file) )) ->values() ->all(); } }