<?php
 namespace App\Support; class NotificationCategoryResolver { private array $map = [ 'New Login Location' => 'exempt', ]; public function resolve(string $templateName, ?string $messageClass = null): string { if ($messageClass === 'marketing') { return 'marketing'; } if (isset($this->map[$templateName])) { return $this->map[$templateName]; } $n = $templateName; if (preg_match('/password|verif|doğrula|two.?factor|security|account access|authorization/i', $n)) { return 'exempt'; } if (preg_match('/invoice|fatura|overdue|payment\s*(confirmation|received|failed|pending|due|overdue|reversed)/i', $n)) { return 'invoice'; } if (preg_match('/service|domain|product[_ ]?change|provision|trial|setup|suspend|terminate|renew|cancellation|contract/i', $n)) { return 'service'; } return 'general'; } } 