*/ public function via(object $notifiable): array { return ['mail']; } public function toMail(User $notifiable): MailMessage { $message = (new MailMessage) ->subject(__('Invoice for your Certified subscription')) ->greeting(__('Hello :name,', ['name' => $notifiable->name])) ->line(__('A new invoice is ready for your :plan subscription.', ['plan' => $this->subscription->plan->label()])); if ($this->invoice->due_date) { $message->line(__('Please pay it before :date to keep your subscription active.', ['date' => $this->invoice->due_date->toFormattedDateString()])); } if ($this->invoice->payment_url) { $message->action(__('Pay invoice'), $this->invoice->payment_url); } return $message->line(__("If payment isn't received in time, we'll automatically switch your account back to the Free plan.")); } }