mivita/app/Mail/MailAutoReleaseAccount.php
Kevin Adametz bfa3bb1df4 08 2024
2024-08-05 12:05:24 +02:00

62 lines
No EOL
2.4 KiB
PHP

<?php
namespace App\Mail;
use App\User;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
class MailAutoReleaseAccount extends Mailable
{
use Queueable, SerializesModels;
protected $user;
public $subject;
public function __construct(User $user)
{
$this->user = $user;
$this->subject = 'Neuer Berater Registrierung und freigeschaltet';
}
public function build()
{
$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 = "Ein neuer Berater hat sich registriert und wurde automatisch freigeschaltet. Seine Daten müssen nachträglich Überprüfung werden:"."\n";
$copy1line .= "+ Überprüfung der Ausweisdaten"."\n";
$copy1line .= "+ Überprüfung des Gewerbenachweises"."\n";
$copy1line .= "+ Eintrag Account ID"."\n";
$copy1line .= "+ Überprüfung / Kenntnisnahme Sponsor"."\n";
$copy1line .= "+ Überprüfung der Rechnungsdaten"."\n";
$copy1line .= 'Sollte Daten nicht vollständig sein, bitte Kontakt zum Berater aufnehmen.'."\n";
return $this->view('emails.info')->with([
'url' => route('admin_lead_edit', $this->user->id).'?show=check_lead',
'title' => 'Berater Registrierung prüfen',
'button' => 'zur Berater Prüfung',
'copy1line' => $copy1line,
'copy2line' => __('email.copy2line'),
'content' => $content,
]);
}
}