mivita/app/Mail/AboCardUpdateLinkMail.php
Kevin 671022a28d Abo: Kreditkarte aktualisieren (CRM, Portal, Berater-Link) + Admin-Abo-Löschung
- Karten-Update ohne Abbuchung via PAYONE creditcardcheck/pseudocardpan
  (AboPaymentMethodService, CardUpdateResult/CreditCardCheckData-DTOs)
- Eingabe nur durch Abo-Inhaber: CRM- und Portal-Formular + zeitlich
  begrenzter Berater→Kunde-Link (AboCardUpdateLink + Mail)
- Änderungshistorie in user_abo_card_changes, Anzeige im Admin-Abo-Detail
- Admin: Abo löschen (destroy) inkl. Test
- Portal-Fix: myOrderCreate wirft 404 statt TypeError bei ungültiger ID
- VIP-Sichtbarkeitstests für Einmalartikel-Fenster ergänzt
- Enthält bereits die Freeze-Guards für den Stripe-Notbetrieb (Folge-Commit)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-08 15:56:19 +00:00

34 lines
1.1 KiB
PHP

<?php
namespace App\Mail;
use App\Models\UserAbo;
use App\Services\Util;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
class AboCardUpdateLinkMail extends Mailable
{
use Queueable, SerializesModels;
public function __construct(public UserAbo $userAbo, public string $token) {}
public function build(): self
{
$firstname = $this->userAbo->shopping_user?->billing_firstname;
$salutation = $firstname ? __('email.hello').' '.$firstname : __('email.hello');
// Link zeigt immer auf das Kundenportal (in.mivita.care), unabhängig vom Versand-Kontext.
$link = rtrim(Util::getMyMivitaPortalUrl(), '/').'/abo/karte/'.$this->token;
return $this->subject(__('abo.card_update_link_mail_subject'))
->view('emails.abo_card_update_link')
->with([
'salutation' => $salutation,
'link' => $link,
'greetings' => __('email.greetings'),
'sender' => __('email.sender'),
]);
}
}