23-01-2026

This commit is contained in:
Kevin Adametz 2026-01-23 17:35:23 +01:00
parent a939cd51ef
commit a8b395e20d
248 changed files with 29342 additions and 4805 deletions

View file

@ -0,0 +1,73 @@
<?php
namespace App\Mail;
use Acme\Dhl\Models\DhlShipment;
use App\Models\ShoppingOrder;
use App\Services\Util;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Collection;
class MailDhlTracking extends Mailable
{
use Queueable, SerializesModels;
protected $shipments;
protected $order;
public $subject;
/**
* Create a new message instance.
*
* @param DhlShipment|Collection $shipments Single shipment or collection of shipments
* @param ShoppingOrder $order
*/
public function __construct($shipments, ShoppingOrder $order)
{
// Accept both single shipment and collection
if ($shipments instanceof DhlShipment) {
$this->shipments = collect([$shipments]);
} else {
$this->shipments = $shipments;
}
$this->order = $order;
// Adjust subject based on number of shipments
if ($this->shipments->count() > 1) {
$this->subject = __('email.dhl_tracking_subject_multiple', ['count' => $this->shipments->count()]);
} else {
$this->subject = __('email.dhl_tracking_subject');
}
}
public function build()
{
$shoppingUser = $this->order->shopping_user;
$salutation = __('email.hello');
if ($shoppingUser && $shoppingUser->billing_firstname) {
$salutation = __('email.hello') . ' ' . $shoppingUser->billing_firstname;
}
// For backward compatibility, also provide single shipment data
$primaryShipment = $this->shipments->first();
return $this->view('emails.dhl_tracking')->with([
'salutation' => $salutation,
'shipments' => $this->shipments,
'shipment' => $primaryShipment, // Backward compatibility
'order' => $this->order,
'trackingNumber' => $primaryShipment->dhl_shipment_no, // Backward compatibility
'trackingUrl' => $primaryShipment->getTrackingUrl(), // Backward compatibility
'orderNumber' => $this->order->getLastShoppingPayment('reference'),
'greetings' => __('email.greetings'),
'sender' => __('email.sender'),
'url' => Util::getMyMivitaUrl(),
]);
}
}

View file

@ -1,16 +1,11 @@
<?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
{
@ -27,15 +22,18 @@ class MailUserLevelUpdate extends Mailable
$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]);
$title = __('email.update_level_title');
$copy1line = __('email.update_level_copy1line', ['tp' => $this->team_points, 'to' => $this->update_to]);
$copy2line = __('email.update_level_copy2line');
$copy3line = __('email.update_level_copy3line');
return $this->view('emails.blank')->with([
'title' => $title,
'copy1line' => $copy1line,
'copy1line' => $copy1line,
'content' => $copy2line . '<br><br>' . $copy3line,
]);
}
}
}

View file

@ -0,0 +1,61 @@
<?php
namespace App\Mail;
use App\User;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
class UserRestoreEmail extends Mailable
{
use Queueable, SerializesModels;
public $user;
public $subject;
/**
* Create a new message instance.
*
* @param User $user
*/
public function __construct(User $user)
{
$this->user = $user;
$this->subject = __('email.user_restore_subject');
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
// Sicherstellen, dass account geladen ist
if (!$this->user->account) {
$this->user->load('account');
}
$firstName = $this->user->account ? $this->user->account->first_name : '';
$title = __('email.user_restore_title');
$greeting = __('email.user_restore_greeting', ['name' => $firstName]);
$copy1line = __('email.user_restore_copy1line');
$copy2line = __('email.user_restore_copy2line');
$copy3line = __('email.user_restore_copy3line');
$payment_account_date = $this->user->getPaymentAccountDateFormat();
$reset_password_url = route('password.request');
return $this->view('emails.user_restore')->with([
'title' => $title,
'greeting' => $greeting,
'copy1line' => $copy1line,
'copy2line' => $copy2line,
'copy3line' => $copy3line,
'payment_account_date' => $payment_account_date,
'reset_password_url' => $reset_password_url,
'user' => $this->user,
]);
}
}