settingsMetadataGateway->getValue(self::KEY_TEMPLATE_HTML) ?? '')); } public function hasCustomTemplate(): bool { return $this->getTemplateHtml() !== ''; } /** * Persist the template. Passing null or an empty/blank string clears it, * restoring the built-in default. Returns false if the value exceeds the * soft length cap. */ public function setTemplateHtml(?string $html): bool { $html = trim((string) ($html ?? '')); if ($html !== '' && strlen($html) > self::MAX_TEMPLATE_LENGTH) { return false; } return $this->settingsMetadataGateway->set( self::KEY_TEMPLATE_HTML, $html !== '' ? $html : null, self::KEY_TEMPLATE_HTML ); } }