user = $user; $this->action = $action; $this->data = $data; if ($this->action === "delete_membership") { $this->subject = 'Mitgliedschaft beenden - beantragt'; } if ($this->action === "check_is_like_customer") { $this->subject = 'Kunden überprüfen - Kundenhoheit'; } if ($this->action === "change_is_like_customer") { $this->subject = 'Kunden erneut überprüfen - Kundenhoheit'; } } public function build() { $content = ""; if ($this->action === "delete_membership") { $content .= __(strtoupper($this->user->account->salutation)) . " "; $content .= $this->user->account->first_name . " " . $this->user->account->last_name . "\n"; $content .= $this->user->account->address . "\n"; $content .= $this->user->account->zipcode . " " . $this->user->account->city . "\n"; $content .= $this->user->account->country_id ? $this->user->account->country->de . "\n\n" : "\n\n"; if ($this->user->account->phone) { $content .= "Telefon: "; $content .= $this->user->account->pre_phone_id ? $this->user->account->pre_phone->phone . " " : " "; $content .= $this->user->account->phone; } if ($this->user->account->mobil) { $content .= "Mobil: "; $content .= $this->user->account->pre_mobil_id ? $this->user->account->pre_mobil->phone . " " : " "; $content .= $this->user->account->mobil; } $content .= "E-Mail: " . $this->user->email; $copy1line = "Infos zum Berater:" . "\n"; $button = "zum Berater"; $title = "Ein Berater möchte seine Mitgliedschaft beenden."; $url = \App\Services\Util::getMyMivitaUrl() . '/admin/lead/edit/' . $this->user->id . '?show=check_lead'; } if ($this->action === "check_is_like_customer") { $copy1line = "Hier geht es zum Kunden:" . "\n"; $button = "zum Kunden"; $title = "Ein Kunden muss überprüft werden und einem Berater zugeordnet werden, da die Adresse nicht eindeutig ist."; $url = \App\Services\Util::getMyMivitaUrl() . '/admin/customer/detail/' . $this->user->id; $content .= $this->user ? 'Firma: ' . $this->user->billing_company . "\n" : ''; $content .= \App\Services\HTMLHelper::getSalutationLang($this->user->billing_salutation) . " "; $content .= $this->user->billing_firstname . " "; $content .= $this->user->billing_lastname . "\n"; $content .= $this->user->billing_address; $content .= $this->user->billing_address_2 ? '/ ' . $this->user->billing_address_2 . "\n" : "\n"; $content .= $this->user->billing_zipcode . " "; $content .= $this->user->billing_city . "\n"; $content .= $this->user->billing_email . "\n"; $content .= $this->user->billing_phone . "\n"; $content .= $this->user->billing_country->getLocated(); } if ($this->action === "change_is_like_customer") { $copy1line = "Hier geht es zum Kunden:" . "\n"; $button = "zum Kunden"; $title = "Ein Kunden muss erneut überprüft werden, da bei einer Änderung eine bestehende Kundenhoheit gefunden wurde."; $url = \App\Services\Util::getMyMivitaUrl() . '/admin/customer/detail/' . $this->user->id; $content .= "Folgende Daten für die Kundenhoheit wurden geändert:" . "\n"; foreach ($this->data as $key => $value) { $content .= $this->user->{$key} . " => " . $value . "\n"; } $content .= "\n" . "\n" . "Rechnungsadresse des Kunden vor der Änderung:" . "\n"; $content .= $this->user ? 'Firma: ' . $this->user->billing_company . "\n" : ''; $content .= \App\Services\HTMLHelper::getSalutationLang($this->user->billing_salutation) . " "; $content .= $this->user->billing_firstname . " "; $content .= $this->user->billing_lastname . "\n"; $content .= $this->user->billing_address; $content .= $this->user->billing_address_2 ? '/ ' . $this->user->billing_address_2 . "\n" : "\n"; $content .= $this->user->billing_zipcode . " "; $content .= $this->user->billing_city . "\n"; $content .= $this->user->billing_email . "\n"; $content .= $this->user->billing_phone . "\n"; $content .= $this->user->billing_country->getLocated(); } return $this->view('emails.info')->with([ 'url' => $url, 'title' => $title, 'button' => $button, 'copy1line' => $copy1line, 'copy2line' => __('email.copy2line'), 'content' => $content, ]); } }