$data */ public function __construct($data) { $this->data = $data; $this->user_shop = Util::getUserShop(); $this->subject = __('contact.mail_subject', ['source' => $this->source()]); $this->replyTo($data['email'], trim(($data['first_name'] ?? '').' '.($data['last_name'] ?? ''))); } public function build() { if (isset($this->data['salutation'])) { if ($this->data['salutation'] === 'mr') { $this->data['salutation'] = 'Herr'; } if ($this->data['salutation'] === 'ms') { $this->data['salutation'] = 'Frau'; } } return $this->view('emails.contact')->with([ 'salutation' => __('contact.mail_headline'), 'copy1line' => __('contact.mail_intro', ['source' => $this->source()]), 'data' => $this->data, 'copy3line' => __('contact.mail_reply_hint'), 'greetings' => __('email.greetings'), 'sender' => __('email.sender'), ]); } private function source(): string { return $this->user_shop ? $this->user_shop->slug.'.mivita.care' : 'mivita.care'; } }