feat(templates): persist reusable content requirements
This commit is contained in:
@@ -146,7 +146,16 @@ class SqlTemplateContentLibrary(TemplateContentLibraryProvider):
|
||||
template_type=request.template_type,
|
||||
usages=list(request.usages),
|
||||
locale=request.locale,
|
||||
required_fields=[],
|
||||
required_fields=[
|
||||
{
|
||||
"path": field.path,
|
||||
"value_type": field.value_type,
|
||||
"label": field.label,
|
||||
"required": field.required,
|
||||
"description": field.description,
|
||||
}
|
||||
for field in request.required_fields
|
||||
],
|
||||
output_profiles=[],
|
||||
content_text=request.content_text,
|
||||
content_html=request.content_html,
|
||||
@@ -168,6 +177,11 @@ class SqlTemplateContentLibrary(TemplateContentLibraryProvider):
|
||||
"definition_hash": revision.definition_hash,
|
||||
"template_type": revision.template_type,
|
||||
"usages": list(revision.usages or []),
|
||||
"required_fields": [
|
||||
str(field.get("path") or "")
|
||||
for field in revision.required_fields or []
|
||||
if field.get("path")
|
||||
],
|
||||
"source": "content_library_capability",
|
||||
},
|
||||
commit=False,
|
||||
|
||||
@@ -104,7 +104,8 @@ DOCUMENTATION = (
|
||||
body=(
|
||||
"Content fragments retain text and HTML variants, usage constraints, locale, scope, revision, and publication state in Templates. "
|
||||
"Campaign can load a fragment or complete email part through the optional content-library capability. Saving from Campaign creates "
|
||||
"a draft and never publishes it automatically. Inserting content changes only the current Campaign draft; existing Campaign versions "
|
||||
"a draft with its declared required-field contract and never publishes it automatically. Consumers show missing required fields before "
|
||||
"applying content. Inserting content changes only the current Campaign draft; existing Campaign versions "
|
||||
"and Template revisions remain unchanged."
|
||||
),
|
||||
layer="available",
|
||||
@@ -118,7 +119,8 @@ DOCUMENTATION = (
|
||||
"body": (
|
||||
"Inhaltsbausteine speichern Text- und HTML-Fassungen, Verwendungszwecke, Sprache, Geltungsbereich, Revision und "
|
||||
"Veröffentlichungsstatus in Templates. Campaign kann Bausteine oder vollständige E-Mail-Teile über die optionale "
|
||||
"Inhaltsbibliothek laden. Das Speichern aus Campaign legt einen Entwurf an und veröffentlicht ihn niemals automatisch. "
|
||||
"Inhaltsbibliothek laden. Das Speichern aus Campaign legt einen Entwurf mit dem deklarierten Pflichtfeldvertrag an und "
|
||||
"veröffentlicht ihn niemals automatisch. Fehlende Pflichtfelder werden vor dem Anwenden angezeigt. "
|
||||
"Das Einfügen ändert nur den aktuellen Kampagnenentwurf; bestehende Kampagnenversionen und Template-Revisionen bleiben unverändert."
|
||||
),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user