$customerRows * @param list $teamRows */ public function __construct( public User $sponsor, public User $consultant, public array $customerRows, public array $teamRows, public bool $consultantBecomesCustomer, ) {} public function build(): self { $name = trim($this->consultant->account?->first_name.' '.$this->consultant->account?->last_name) ?: $this->consultant->email; $customers = $this->customerRows; if ($this->consultantBecomesCustomer) { array_unshift($customers, [ 'first_name' => (string) $this->consultant->account?->first_name, 'last_name' => (string) $this->consultant->account?->last_name, 'phone' => trim((string) $this->consultant->account?->getPhoneNumber()), 'email' => UserUtil::stripDeletePrefix($this->consultant->email), ]); } return $this->subject(__('suspension.transfer_subject', ['name' => $name])) ->view('emails.consultant_suspension') ->with([ 'headline' => __('suspension.transfer_subject', ['name' => $name]), 'salutation' => __('email.hello').' '.($this->sponsor->account?->first_name ?? ''), 'paragraphs' => [__('suspension.transfer_intro', ['name' => $name])], 'customers' => $customers, 'team' => $this->teamRows, 'greetings' => __('email.greetings'), 'sender' => __('email.sender'), ]); } }