*/ public function via(object $notifiable): array { return ['mail']; } /** * Get the mail representation of the notification. */ public function toMail(object $notifiable): MailMessage { $locale = $notifiable->preferred_language ?? 'ar'; $typeName = $this->newUserType === UserType::Company ? __('clients.company', [], $locale) : __('clients.individual', [], $locale); return (new MailMessage) ->subject(__('emails.account_type_changed_subject', [], $locale)) ->view('emails.account-type-changed', [ 'user' => $notifiable, 'newType' => $typeName, 'locale' => $locale, ]); } /** * Get the array representation of the notification. * * @return array */ public function toArray(object $notifiable): array { return [ 'new_user_type' => $this->newUserType->value, ]; } }