$variables Placeholder name => description. * @param string $defaultText Message body used until an admin edits it. * @param string $description Optional one-line explanation. * @param string $short Name within its tab and group, e.g. the order status alone. * @param string $kind How the send rules treat it: `immediate` (default; never held * back), `service` (waits out quiet hours) or `promotional` * (quiet hours, opt-out, cap). See SendPolicy. */ public function __construct( public string $id, public string $group, public string $label, public string $audience, public array $variables = [], public string $defaultText = '', public string $description = '', public string $short = '', public string $kind = 'immediate' ) {} /** * Is this addressed to the shop's own staff? */ public function isForAdmin(): bool { return self::AUDIENCE_ADMIN === $this->audience; } /** * Settings key under which this notification's configuration is stored. * * Derived from the id rather than stored, so adding a notification needs no * migration and removing one leaves an orphan row that is simply ignored. */ public function settingsKey(): string { return str_replace( '.', '_', $this->id ); } }