YAML import / export for email templates stored in
def_email_template. Round-trips one template at a time
between the database and a YAML file under
local.documents/email_templates/, so templates can be
versioned, edited offline, and replayed back into any
environment.
Mixin pattern (ObjEditBase first, primary class second):
class ObjMailEdit(ObjEditBase, ObjTemplate.ObjTemplate):
...
# List visible templates (own package + shared rows with empty Package)
python factory.core/extend.edit/ObjMailEdit.py list
python factory.core/extend.edit/ObjMailEdit.py list --package homechoice
# Export a template to YAML (file lands in local.documents/email_templates/)
python factory.core/extend.edit/ObjMailEdit.py save SIMULATION_OVERVIEW
python factory.core/extend.edit/ObjMailEdit.py save SIMULATION_OVERVIEW \
--filename simulation_overview.yaml --package homechoice
# Import a template from YAML (REPLACE INTO def_email_template)
python factory.core/extend.edit/ObjMailEdit.py load simulation_overview.yaml
python factory.core/extend.edit/ObjMailEdit.py load /abs/path/to/file.yaml \
--package homechoice
from factory.core.extend.edit.ObjMailEdit import ObjMailEdit
edit = ObjMailEdit()
edit.export_to_file("SIMULATION_OVERVIEW")
edit.import_from_file("simulation_overview.yaml")
edit.list_templates(package="homechoice")
export_to_file drops UpdateDate (DB-managed) and writesSubject, Body, and Description as YAML literal block|) for diff-friendly multi-line content.import_from_data / import_from_file use REPLACE INTO,load and list_templates query both the active packagePackage=''), preferring the package-specificlocal.documents/email_templates/. TheObjMailEdit.py - mixin + typer CLI.ObjEditBase.py - shared YAML helpers (LiteralDumper,LiteralString, null stripping).ObjTemplate.py - primary class managing def_email_template