*/ public function via(object $notifiable): array { return ['mail']; } /** * Get the mail representation of the notification. */ public function toMail(object $notifiable): MailMessage { $tenant = $this->purchase->tenant; $package = $this->purchase->package; $amount = number_format((float) $this->purchase->price, 2); $currency = data_get($this->purchase->metadata, 'currency', 'EUR'); $locale = app()->getLocale(); $packageName = $package?->getNameForLocale($locale) ?? $package?->name ?? __('emails.package_limits.package_fallback', [], $locale); $subject = __('emails.withdrawal_confirmation.subject', ['package' => $packageName]); $greeting = __('emails.withdrawal_confirmation.greeting', [ 'name' => $tenant?->name ?? __('emails.package_limits.team_fallback'), ]); return (new MailMessage) ->subject($subject) ->view('emails.withdrawal-confirmation', [ 'subject' => $subject, 'greeting' => $greeting, 'packageName' => $packageName, 'amount' => $amount, 'currency' => $currency, 'providerId' => $this->purchase->provider_id ?? '—', 'confirmedAt' => $this->confirmedAt, ]); } }