order = $order; } /** * Get the notification's delivery channels. * * @param mixed $notifiable * @return array * @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass */ public function via($notifiable) { // phpcs:enable return ['mail']; } /** * Get the mail representation of the notification. * * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage * @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass */ public function toMail($notifiable) { // phpcs:enable if ($this->order->validation_status->equals(ValidationStatus::validated())) { return (new MailMessage()) ->subject(\trans('Votre commande viens d\'être validée :appname', ['appname' => \config('app.name')])) ->greeting(trans('Votre commande avec pour référence :ref à été validée', [ 'ref' => $this->order->reference ])) ->line(\trans('Vous pouvez retrouver les informations et nottament le créneau de collecte')) ->line(\trans('qui vous est réservé dans votre espace personel')); } else { return (new MailMessage()) ->subject(\trans('Votre commande viens d\'être refusée :appname', ['appname' => \config('app.name')])) ->greeting(trans('Votre commande avec pour référence :ref à été refusée', [ 'ref' => $this->order->reference ])) ->line(\trans('Nous sommes dans l\'incapacitée de traiter votre commande, veuillez nous en excuser,')) ->line(\trans('pour avoir plus d\'information vous pouvez nous contacter via un de nos magasins')) ->line(\trans('ou le formulaire de contact du site.')) ->line('Merci d\'avoir utilisé notre application'); } //end if } /** * Get the array representation of the notification. * * @param mixed $notifiable * @return array * @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass */ public function toArray($notifiable) { // phpcs:enable return [ 'order_id' => $this->order->id ]; } }