update 20.10.2025

This commit is contained in:
Kevin Adametz 2025-10-20 17:42:08 +02:00
parent 8c11130b5d
commit a939cd51ef
616 changed files with 84821 additions and 4121 deletions

View file

@ -0,0 +1,38 @@
<?php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
class Exception extends Mailable
{
use Queueable, SerializesModels;
public $content;
public $css;
/**
* Create a new message instance.
*
* @param $data
*/
public function __construct($css, $content)
{
$this->css = $css;
$this->content = $content;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this->view('emails.exception')
->subject('mivita Exception Logged!')
->with([
'content' => $this->content,
'css' => $this->css,
]);
}
}

View file

@ -0,0 +1,48 @@
<?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 MailAccountActive extends Mailable
{
use Queueable, SerializesModels;
protected $confirmation_code;
protected $user;
public $subject;
public function __construct(User $user)
{
$this->user = $user;
$this->subject = __('email.account_active');
}
public function build()
{
$salutation = __('email.salutation').",";
if($this->user->account){
if($this->user->account->salutation === "mr"){
$salutation = __('email.dear_sir')." ".$this->user->account->first_name.",";
}else{
$salutation = __('email.dear_mrs')." ".$this->user->account->first_name.",";
}
}
return $this->view('emails.auth')->with([
'url' => route('login'),
'salutation' => $salutation,
'button' => __('Login'),
'copy1line' => __('email.account_active_copy1line'),
'copy2line' => __('email.copy2line'),
'copy3line' => __('email.copy3line'),
'greetings' => __('email.greetings'),
'sender' => __('email.sender'),
]);
}
}

View file

@ -0,0 +1,46 @@
<?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 MailActivateUser extends Mailable
{
use Queueable, SerializesModels;
protected $token;
protected $user;
public $subject;
public function __construct($token, User $user)
{
$this->token = $token;
$this->user = $user;
$this->subject = __('email.change_e_mail');
}
public function build()
{
$salutation = __('email.salutation').",";
if($this->user->account){
if($this->user->account->salutation === "mr"){
$salutation = __('email.dear_sir')." ".$this->user->account->first_name.",";
}else{
$salutation = __('email.dear_mrs')." ".$this->user->account->first_name.",";
}
}
return $this->view('emails.auth')->with([
'url' => route('user_update_email_confirm', $this->token),
'salutation' => $salutation,
'button' => __('email.change_e_mail'),
'copy1line' => __('email.active_copy1line'),
'copy2line' => __('email.copy2line'),
'copy3line' => __('email.copy3line'),
'greetings' => __('email.greetings'),
'sender' => __('email.sender'),
]);
}
}

View file

@ -0,0 +1,63 @@
<?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' => \App\Services\Util::getMyMivitaUrl() . '/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,
]);
}
}

View file

@ -0,0 +1,92 @@
<?php
namespace App\Mail;
use App\User;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
use App\Services\Util;
class MailCheckout extends Mailable
{
use Queueable, SerializesModels;
protected $txaction;
protected $shopping_order;
protected $shopping_payment;
protected $send_link;
protected $mode;
protected $payment_error;
public $subject;
public $data;
public function __construct($txaction, $shopping_order, $shopping_payment, $send_link, $mode, $payment_error = false)
{
$this->txaction = $txaction;
$this->shopping_order = $shopping_order;
$this->shopping_payment = $shopping_payment;
$this->send_link = $send_link;
$this->mode = $mode;
$this->payment_error = $payment_error;
if($this->txaction === 'paid'){
$this->subject = __('email.checkout_subject_paid')." ";
$this->subject .= "mivita.care";
}elseif($this->txaction === 'extern'){
$this->subject = __('email.checkout_subject_extern').": ";
$this->subject .= $shopping_order->member->account->m_first_name." ".$shopping_order->member->account->m_last_name." - ";
$this->subject .= $shopping_order->shopping_user->billing_firstname." ".$shopping_order->shopping_user->billing_lastname;
}else{
$this->subject = __('email.checkout_subject')." ";
$this->subject .= "mivita.care";
}
/*if($shopping_order->user_shop){
$this->subject .= $shopping_order->user_shop->slug.".";
}*/
}
public function build()
{
$salutation = __('email.hello').",";
if($this->txaction !== 'extern' && $this->shopping_order->shopping_user){
$salutation = __('email.hello')." ".$this->shopping_order->shopping_user->billing_firstname.",";
//make Adresse
}
if($this->txaction === 'paid' || $this->txaction === 'extern'){
return $this->view('emails.checkout')->with([
'salutation' => $salutation,
'copy1line' => __('email.checkout_copy1line'),
'shopping_order' => $this->shopping_order,
'shopping_payment' => $this->shopping_payment,
'copy3line' => __('email.checkout_copy3line'),
'greetings' => __('email.greetings'),
'sender' => __('email.sender'),
'send_link' => $this->send_link,
'url' => Util::getMyMivitaUrl(),
'button' => Util::getMyMivitaUrl(false),
'mode' => $this->mode
]);
}else{
return $this->view('emails.checkout_status')->with([
'salutation' => $salutation,
'copy1line' => __('email.status_copy1line'),
'txaction' => $this->txaction,
'shopping_order' => $this->shopping_order,
'shopping_payment' => $this->shopping_payment,
'payment_error' => $this->payment_error,
'copy3line' => __('email.checkout_copy3line'),
'greetings' => __('email.greetings'),
'sender' => __('email.sender'),
'send_link' => false,
'mode' => $this->mode
]);
}
}
}

View file

@ -0,0 +1,59 @@
<?php
namespace App\Mail;
use App\User;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
use App\Services\Util;
class MailContact extends Mailable
{
use Queueable, SerializesModels;
public $user_shop;
public $subject;
public $data;
public function __construct($data)
{
$this->data = $data;
$this->user_shop = Util::getUserShop();
$this->subject = __('email.your_request_from').' mivita.care';
if($this->user_shop){
$this->subject = __('email.your_request_from')." ".$this->user_shop->slug.'.mivita.care';
}
}
public function build()
{
$salutation = __('email.hello');
if(isset($this->data['first_name'])){
$salutation .= " ".$this->data['first_name'];
}
if(isset($this->data['salutation'])){
if($this->data['salutation'] === 'mr'){
$this->data['salutation'] = 'Herr';
}
if($this->data['salutation'] === 'ms'){
$this->data['salutation'] = 'Frau';
}
}
$copy1line = __('email.your_request_from')." mivita.care";
if($this->user_shop){
$copy1line = __('email.your_request_from')." ".$this->user_shop->slug.'.mivita.care';
}
return $this->view('emails.contact')->with([
'salutation' => $salutation,
'copy1line' => $copy1line,
'data' => $this->data,
'copy3line' => __('email.copy3line'),
'greetings' => __('email.greetings'),
'sender' => __('email.sender'),
]);
}
}

View file

@ -0,0 +1,57 @@
<?php
namespace App\Mail;
use Storage;
use App\User;
use App\Services\Credit;
use App\Services\Invoice;
use App\Models\UserCredit;
use App\Models\ShoppingOrder;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
class MailCredit extends Mailable
{
use Queueable, SerializesModels;
protected $user_credit;
public $subject;
public function __construct(UserCredit $user_credit)
{
$this->user_credit = $user_credit;
$this->subject = __('email.credit_title');
}
public function build()
{
$title = 'Hallo ';
$copy1line = __('email.credit_copy1line');
if(isset($this->user_credit->user->account)){
$title .= $this->user_credit->user->account->m_first_name.",";
}
$filename = $this->user_credit->filename;
$disk = $this->user_credit->disk;
$path = $this->user_credit->getDownloadPath();
if (!Storage::disk($disk)->exists($path)) {
return;
}
$file = Storage::disk($disk)->path($path);
$file = str_replace('//', '/', $file);
$mime = Storage::disk($disk)->mimeType($path);
return $this->view('emails.blank')->with([
'title' => $title,
'copy1line' => $copy1line,
])->attach($file,[
'as' => $filename,
'mime' => $mime,
]); // attach file;
}
}

View file

@ -0,0 +1,83 @@
<?php
namespace App\Mail;
use App\Models\UserMessage;
use App\User;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
class MailCustomMessage extends Mailable
{
use Queueable, SerializesModels;
protected $data;
protected $user;
protected $sender;
public $subject;
public $message;
public $message_last;
protected $save;
public function __construct(User $user, $data, $sender, $save = false)
{
$this->save = $save;
$this->data = $data;
$this->user = $user;
$this->sender = $sender;
$this->subject = isset($data['subject']) ? $data['subject'] : __('email.email_subject');
$this->message = isset($data['message']) ? $data['message'] : '';
$this->message_last = isset($data['message_last']) ? $data['message_last'] : '';
}
public function build()
{
$salutation = __('email.salutation').",";
if($this->user->account){
if($this->user->account->salutation === "mr"){
$salutation = __('email.dear_sir')." ".$this->user->account->first_name.",";
}else{
$salutation = __('email.dear_mrs')." ".$this->user->account->first_name.",";
}
}
if($this->save){
UserMessage::create([
'user_id' => $this->user->id,
'send_user_id' => $this->sender->id,
'email' => $this->user->email,
'subject' => $this->subject,
'message' => $this->message." ".$this->message_last,
'send' => true,
'sent_at' => now(),
]);
}
$url = "";
$button = "";
if(isset($this->data['confirmation_code'])){
$url = route('register_verify', $this->data['confirmation_code']);
$button = __('email.button_account');
}
if(isset($this->data['url'])){
$url =$this->data['url'];
$button = $this->data['button'];
}
return $this->view('emails.custom')->with([
'url' => $url,
'title' => $salutation,
'button' => $button,
'content' => $this->message,
'content_last' => $this->message_last,
'copy2line' => __('email.copy2line'),
'copy3line' => __('email.copy3line'),
'greetings' => __('email.greetings'),
'sender' => __('email.sender'),
]);
}
}

View file

@ -0,0 +1,62 @@
<?php
namespace App\Mail;
use App\User;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
use App\Services\Util;
class MailCustomPaymet extends Mailable
{
use Queueable, SerializesModels;
protected $route;
protected $shopping_user;
protected $shopping_instance;
protected $mode;
protected $name;
protected $yard_shopping_items;
protected $is_abo;
protected $is_for;
public $subject;
public $data;
public function __construct($route, $shopping_user, $shopping_instance, $yard_shopping_items, $mode)
{
$this->route = $route;
$this->shopping_user = $shopping_user;
$this->shopping_instance = $shopping_instance;
$this->mode = $mode;
$this->yard_shopping_items = $yard_shopping_items;
$this->is_abo = isset($shopping_instance->shopping_data['is_abo']) ? $shopping_instance->shopping_data['is_abo'] : 0;
$this->is_for = isset($shopping_instance->shopping_data['is_for']) ? $shopping_instance->shopping_data['is_for'] : 0;
$this->name = $shopping_user->member->account->first_name." ".$shopping_user->member->account->last_name." - ";
$this->subject =$this->is_abo ? __('email.subject_custom_abo_payout', ['name' => $this->name]) : __('email.subject_custom_payout', ['name' => $this->name]);
}
public function build()
{
$salutation = __('email.hello')." ".$this->shopping_user->billing_firstname.",";
return $this->view('emails.custom_payment')->with([
'salutation' => $salutation,
'copy1line' => $this->is_abo ? __('email.your_custom_abo_payout', ['name' => $this->name]) : __('email.your_custom_payout', ['name' => $this->name]),
'shopping_user' => $this->shopping_user,
'shopping_instance' => $this->shopping_instance,
'yard_shopping_items' => $this->yard_shopping_items,
'is_abo' => $this->is_abo,
'is_for' => $this->is_for,
'copy3line' => __('email.checkout_copy3line'),
'greetings' => __('email.greetings'),
'route' => $this->route,
'mode' => $this->mode,
'sender' => __('email.sender'),
]);
}
}

View file

@ -0,0 +1,117 @@
<?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 MailInfo extends Mailable
{
use Queueable, SerializesModels;
protected $user;
protected $action;
protected $data;
public $subject;
public function __construct($user, $action, $data = [])
{
$this->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,
]);
}
}

View file

@ -0,0 +1,52 @@
<?php
namespace App\Mail;
use App\Services\Invoice;
use App\Models\ShoppingOrder;
use App\Models\UserInvoice;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Storage;
class MailInvoice extends Mailable
{
use Queueable, SerializesModels;
protected $shopping_order;
protected $user_invoice;
public $subject;
public function __construct(ShoppingOrder $shopping_order, UserInvoice $user_invoice)
{
$this->shopping_order = $shopping_order;
$this->user_invoice = $user_invoice;
$this->subject = __('email.invoice_subject').': '.$shopping_order->getLastShoppingPayment('reference') ;
}
public function build()
{
$title = __('email.invoice_title');
$copy1line = __('email.invoice_copy1line').$this->shopping_order->getLastShoppingPayment('reference');
$filename = $this->user_invoice->filename;
$disk = $this->user_invoice->disk;
$path = $this->user_invoice->getDownloadPath();
if (!Storage::disk($disk)->exists($path)) {
return;
}
$file = Storage::disk($disk)->path($path);
$file = str_replace('//', '/', $file);
$mime = Storage::disk($disk)->mimeType($path);
return $this->view('emails.blank')->with([
'title' => $title,
'copy1line' => $copy1line,
])->attach($file,[
'as' => $filename,
'mime' => $mime,
]); // attach file;
}
}

View file

@ -0,0 +1,63 @@
<?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 MailLog extends Mailable
{
use Queueable, SerializesModels;
protected $channel;
protected $context;
protected $message;
protected $data;
public $subject;
public function __construct($channel, $context, $message, $data)
{
$this->channel = $channel;
$this->context = $context;
$this->message = $message;
$this->data = $data;
$this->subject = 'mivita Log';
}
public function build()
{
$title = 'Log: '.$this->channel.' '.$this->context;
//make Data readable
$this->data = json_encode($this->data, JSON_PRETTY_PRINT);
$content = "";
$content .= "\n";
$content .= "Channel: ".$this->channel."\n";
$content .= "Context: ".$this->context."\n";
if(\Auth::check()){
$content .= "From User: ".\Auth::user()->id." | ".\Auth::user()->email."\n";
}
$content .= "\n";
$content .= "Message: ".$this->message."\n";
$content .= "\n";
$content .= "Data: ".$this->data."\n";
$content .= "\n";
$content .= "\n";
$content .= "Time: ".now()->format("d.m.Y H:i");
$content .= "\n";
$content .= request()->header('User-Agent');
return $this->view('emails.sys')->with([
'title' => $title,
'content' => $content,
]);
}
}

View file

@ -0,0 +1,43 @@
<?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 MailOTPCustomer extends Mailable
{
use Queueable, SerializesModels;
protected $otp;
protected $email;
public $subject;
public function __construct($otp, $email)
{
$this->otp = $otp;
$this->email = $email;
$this->subject = __('portal.mail_subject');
}
public function build()
{
return $this->view('emails.auth')->with([
'otp' => $this->otp,
'url' => route('portal.login.otp.form', ['email' => $this->email, 'otp' => $this->otp]),
'button' => __('portal.login_button'),
'salutation' => __('portal.mail_hello'),
'copy1line' => __('portal.mail_otp'),
'copy2line' => __('portal.mail_otp_valid'),
'copy3line' => __('portal.mail_otp_not_requested'),
'greetings' => __('portal.mail_greetings'),
'sender' => __('portal.mail_sender'),
]);
}
}

View file

@ -0,0 +1,64 @@
<?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 MailReleaseAccount extends Mailable
{
use Queueable, SerializesModels;
protected $user;
public $subject;
public function __construct(User $user)
{
$this->user = $user;
$this->subject = 'Neuer Berater Registrierung prüfen';
}
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 wartet auf die Überprüfung und Freigabe seiner Daten:" . "\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 .= 'Nach erfolgreicher Überprüfung mit dem Button „Daten vollständig => Berater freischalten“ den Berater freischalten.' . "\n";
$copy1line .= 'Der Berater erhält eine Mail, dass sein Account freigeschaltet wurde. Der Vertrag wird automatisch mit den Daten des Vertriebspartners erstellt.' . "\n";
return $this->view('emails.info')->with([
'url' => \App\Services\Util::getMyMivitaUrl() . '/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,
]);
}
}

View file

@ -0,0 +1,60 @@
<?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 MailReleaseDocument extends Mailable
{
use Queueable, SerializesModels;
protected $user;
public $subject;
public function __construct(User $user)
{
$this->user = $user;
$this->subject = 'Berater Unterlagen prüfen';
}
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";
$content .= "E-Mail: " . $this->user->email;
$copy1line = "Ein Berater hat Daten zum Gewerbenachweis geändert, bitte um Prüfung:" . "\n\n";
$business_license_choose = $this->user->account->getNotice('business_license');
if ($business_license_choose === 'now') {
$copy1line .= "+ Gewerbeschein jetzt zur Freigabe" . "\n\n";
}
if ($business_license_choose === 'later') {
$copy1line .= "+ Ich reiche meinen Gewerbeschein innerhalb der nächsten 4 Wochen nach" . "\n\n";
}
if ($business_license_choose === 'non') {
$copy1line .= "+ Ich benötige keinen Gewerbeschein" . "\n";
$copy1line .= "+ Begründung: " . $this->user->account->getNotice('business_license_reason') . "\n\n";
}
$copy1line .= 'Bei fehlerhafter Angabe nimm bitte kontakt mit dem Berater auf.' . "\n";
return $this->view('emails.info')->with([
'url' => \App\Services\Util::getMyMivitaUrl() . '/admin/lead/edit/' . $this->user->id . '?show=check_lead',
'title' => 'Berater Unterlagen prüfen',
'button' => 'zur Berater Prüfung',
'copy1line' => $copy1line,
'copy2line' => __('email.copy2line'),
'content' => $content,
]);
}
}

View file

@ -0,0 +1,51 @@
<?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 MailResetPassword extends Mailable
{
use Queueable, SerializesModels;
protected $token;
protected $user;
public $subject;
public function __construct($token, $user)
{
$this->token = $token;
$this->user = $user;
$this->subject = __('email.reset_passwort');
}
public function build()
{
$salutation = __('email.salutation').",";
if($this->user->account){
if($this->user->account->salutation === "mr"){
$salutation = __('email.dear_sir')." ".$this->user->account->first_name.",";
}else{
$salutation = __('email.dear_mrs')." ".$this->user->account->first_name.",";
}
}
return $this->view('emails.auth')->with([
'url' => route('password.reset', $this->token),
'salutation' => $salutation,
'button' => __('email.reset_passwort'),
'copy1line' => __('email.reset_pass_copy1line'),
'copy2line' => __('email.copy2line'),
'copy3line' => __('email.copy3line'),
'greetings' => __('email.greetings'),
'sender' => __('email.sender'),
]);
}
}

View file

@ -0,0 +1,63 @@
<?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 MailSyS extends Mailable
{
use Queueable, SerializesModels;
protected $model;
protected $action;
public $subject;
public function __construct($model, $action)
{
$this->model = $model;
$this->action = $action;
if($this->action === "log"){
$this->subject = 'mivita Logger';
}
}
public function build()
{
$content = "";
if($this->action === "log"){
$title = "New Log";
if($this->model->user_id && $this->model->user){
$content .= "From User: ".$this->model->user->id." | ".$this->model->user->email."\n";
}
if($this->model->model && $this->model->model_id){
$content .= "Apply: ".$this->model->model." | ".$this->model->model_id."\n";
if($this->model->model === 'App\User'){
$apply = User::find($this->model->model_id);
$content .= $this->model->model.": ".$apply->email." | ".$this->model->model_id."\n";
}
}
$content .= "\n";
$content .= "Action: ".$this->model->action."\n";
$content .= "Message: ".$this->model->message."\n";
$content .= "\n";
$content .= "Channel: ".$this->model->channel."\n";
$content .= "Level: ".$this->model->getLevelType()."\n";
$content .= "\n";
$content .= "Time: ".$this->model->created_at->format("d.m.Y H:i");
}
return $this->view('emails.sys')->with([
'title' => $title,
'content' => $content,
]);
}
}

View file

@ -0,0 +1,41 @@
<?php
namespace App\Mail;
use Storage;
use App\User;
use App\Services\Credit;
use App\Services\Invoice;
use App\Models\UserCredit;
use App\Models\ShoppingOrder;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
class MailUserLevelUpdate extends Mailable
{
use Queueable, SerializesModels;
protected $team_points;
protected $update_to;
public $subject;
public function __construct($team_points, $update_to)
{
$this->team_points = $team_points;
$this->update_to = $update_to;
$this->subject = __('email.update_level_title');
}
public function build()
{
$title = __('email.update_level_title');
$copy1line = __('email.update_level_copy1line', ['tp'=>$this->team_points, 'to'=>$this->update_to]);
return $this->view('emails.blank')->with([
'title' => $title,
'copy1line' => $copy1line,
]);
}
}

View file

@ -0,0 +1,49 @@
<?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 MailVerifyAccount extends Mailable
{
use Queueable, SerializesModels;
protected $confirmation_code;
protected $user;
public $subject;
public function __construct($confirmation_code, User $user)
{
$this->confirmation_code = $confirmation_code;
$this->user = $user;
$this->subject = __('email.email_verify');
}
public function build()
{
$salutation = __('email.salutation').",";
if($this->user->account){
if($this->user->account->salutation === "mr"){
$salutation = __('email.dear_sir')." ".$this->user->account->first_name.",";
}else{
$salutation = __('email.dear_mrs')." ".$this->user->account->first_name.",";
}
}
return $this->view('emails.auth')->with([
'url' => route('register_verify', $this->confirmation_code),
'salutation' => $salutation,
'button' => __('email.email_verify'),
'copy1line' => __('email.email_verify_copy1line'),
'copy2line' => __('email.copy2line'),
'copy3line' => __('email.copy3line'),
'greetings' => __('email.greetings'),
'sender' => __('email.sender'),
]);
}
}

View file

@ -0,0 +1,48 @@
<?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 MailVerifyContact extends Mailable
{
use Queueable, SerializesModels;
protected $confirmation_code;
protected $user;
public $subject;
public function __construct($confirmation_code, User $user)
{
$this->confirmation_code = $confirmation_code;
$this->user = $user;
$this->subject = __('email.verify_e_mail');
}
public function build()
{
$salutation = __('email.salutation').",";
if($this->user->account){
if($this->user->account->salutation === "mr"){
$salutation = __('email.dear_sir')." ".$this->user->account->first_name.",";
}else{
$salutation = __('email.dear_mrs')." ".$this->user->account->first_name.",";
}
}
return $this->view('emails.auth')->with([
'url' => route('register_verify', $this->confirmation_code),
'salutation' => $salutation,
'button' => __('email.verify_e_mail'),
'copy1line' => __('email.verify_copy1line'),
'copy2line' => __('email.copy2line'),
'copy3line' => __('email.copy3line'),
'greetings' => __('email.greetings'),
'sender' => __('email.sender'),
]);
}
}