Topolo Docs Topolo Platform
Open workspace

Preview email template

Render a saved template version (templateId, version?) or an unsaved draft to email-safe HTML (tables, inline styles, dark-mode and mobile rules) plus the auto-generated plain-text alternative, for an optional sample contact. Brand name, email logo, light and dark accent colours, footer, legal entity, postal address and unsubscribe wording come from the workspace TopoloBrand kit when one is bound and readable, else the workspace template brand settings, else neutral defaults; Brand being unavailable never fails a preview. Unsubscribe and preference links are inert placeholders (#unsubscribe, #preferences); a real send substitutes signed recipient links. No side effects: nothing is saved or sent.

Outcome

Render a saved template version (templateId, version?) or an unsaved draft to email-safe HTML (tables, inline styles, dark-mode and mobile rules) plus the auto-generated plain-text alternative, for an optional sample contact. Brand name, email logo, light and dark accent colours, footer, legal entity, postal address and unsubscribe wording come from the workspace TopoloBrand kit when one is bound and readable, else the workspace template brand settings, else neutral defaults; Brand being unavailable never fails a preview. Unsubscribe and preference links are inert placeholders (#unsubscribe, #preferences); a real send substitutes signed recipient links. No side effects: nothing is saved or sent.

Before you start

  • Verify identity and pin the intended organization and environment before discovering the action.
  • Discover a granted Nurture workspace. The application permission is workspace:read; required workspace access is read. A permission alone does not supply a workspace grant.
  • Organization and workspace come from verified context. Select resourceType/resourceId separately from action input; body fields cannot grant a different organization or workspace. The first authorized product action can initialize an identity-only workspace mirror.

Discover the target

topolo whoami --json
topolo actions get app_topolo_nurture.templates.render_preview --detail --json
topolo resources topolo-nurture --json
topolo workspaces list topolo-nurture --json
topolo actions get app_topolo_nurture.templates.list --detail --json
topolo actions get app_topolo_nurture.templates.get --detail --json
  • templateId: Nurture template id; inspect its active state and version.
  • version: Integer template version, separate from the template id.

Request

POST /api/templates/preview

Save action input as payload.json. The reviewed plan separates path identifiers, query fields and HTTP body. Set NURTURE_WORKSPACE_ID from granted resource discovery; it is separate from action input.

Inspect and test this action in the signed action console. A test response still requires the verification below.

Input fields

FieldRequiredTypeConstraints
templateIdOptionalstringNurture template id; inspect its active state and version. {"minLength":1,"maxLength":64}
versionOptionalintegerInteger template version, separate from the template id. {"minimum":1,"maximum":9007199254740991}
draftOptionalobject{}
sampleContactOptionalobject{}

Exact input schema:

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "templateId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 64
    },
    "version": {
      "type": "integer",
      "minimum": 1,
      "maximum": 9007199254740991
    },
    "draft": {
      "type": "object",
      "properties": {
        "subject": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "preheader": {
          "type": "string",
          "maxLength": 200
        },
        "blocks": {
          "minItems": 1,
          "maxItems": 100,
          "type": "array",
          "items": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
                  },
                  "kind": {
                    "type": "string",
                    "const": "heading"
                  },
                  "text": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 300
                  },
                  "level": {
                    "anyOf": [
                      {
                        "type": "number",
                        "const": 1
                      },
                      {
                        "type": "number",
                        "const": 2
                      },
                      {
                        "type": "number",
                        "const": 3
                      }
                    ]
                  },
                  "align": {
                    "type": "string",
                    "enum": [
                      "left",
                      "center",
                      "right"
                    ]
                  }
                },
                "required": [
                  "id",
                  "kind",
                  "text",
                  "level"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
                  },
                  "kind": {
                    "type": "string",
                    "const": "text"
                  },
                  "text": {
                    "type": "string",
                    "maxLength": 10000
                  },
                  "align": {
                    "type": "string",
                    "enum": [
                      "left",
                      "center",
                      "right"
                    ]
                  }
                },
                "required": [
                  "id",
                  "kind",
                  "text"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
                  },
                  "kind": {
                    "type": "string",
                    "const": "image"
                  },
                  "src": {
                    "type": "string",
                    "maxLength": 2000,
                    "pattern": "^https:\\/\\/[^\\s\"'<>]+$"
                  },
                  "alt": {
                    "type": "string",
                    "maxLength": 300
                  },
                  "width": {
                    "type": "integer",
                    "minimum": 16,
                    "maximum": 600
                  },
                  "href": {
                    "type": "string",
                    "maxLength": 2000,
                    "pattern": "^(https:\\/\\/|mailto:)[^\\s\"'<>]+$"
                  }
                },
                "required": [
                  "id",
                  "kind",
                  "src",
                  "alt"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
                  },
                  "kind": {
                    "type": "string",
                    "const": "button"
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "href": {
                    "type": "string",
                    "maxLength": 2000,
                    "pattern": "^(https:\\/\\/|mailto:)[^\\s\"'<>]+$"
                  },
                  "align": {
                    "type": "string",
                    "enum": [
                      "left",
                      "center",
                      "right"
                    ]
                  }
                },
                "required": [
                  "id",
                  "kind",
                  "label",
                  "href"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
                  },
                  "kind": {
                    "type": "string",
                    "const": "divider"
                  }
                },
                "required": [
                  "id",
                  "kind"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
                  },
                  "kind": {
                    "type": "string",
                    "const": "spacer"
                  },
                  "height": {
                    "type": "integer",
                    "minimum": 4,
                    "maximum": 96
                  }
                },
                "required": [
                  "id",
                  "kind",
                  "height"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
                  },
                  "kind": {
                    "type": "string",
                    "const": "columns"
                  },
                  "columns": {
                    "minItems": 2,
                    "maxItems": 3,
                    "type": "array",
                    "items": {
                      "maxItems": 10,
                      "type": "array",
                      "items": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
                              },
                              "kind": {
                                "type": "string",
                                "const": "heading"
                              },
                              "text": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 300
                              },
                              "level": {
                                "anyOf": [
                                  {
                                    "type": "number",
                                    "const": 1
                                  },
                                  {
                                    "type": "number",
                                    "const": 2
                                  },
                                  {
                                    "type": "number",
                                    "const": 3
                                  }
                                ]
                              },
                              "align": {
                                "type": "string",
                                "enum": [
                                  "left",
                                  "center",
                                  "right"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "kind",
                              "text",
                              "level"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
                              },
                              "kind": {
                                "type": "string",
                                "const": "text"
                              },
                              "text": {
                                "type": "string",
                                "maxLength": 10000
                              },
                              "align": {
                                "type": "string",
                                "enum": [
                                  "left",
                                  "center",
                                  "right"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "kind",
                              "text"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
                              },
                              "kind": {
                                "type": "string",
                                "const": "image"
                              },
                              "src": {
                                "type": "string",
                                "maxLength": 2000,
                                "pattern": "^https:\\/\\/[^\\s\"'<>]+$"
                              },
                              "alt": {
                                "type": "string",
                                "maxLength": 300
                              },
                              "width": {
                                "type": "integer",
                                "minimum": 16,
                                "maximum": 600
                              },
                              "href": {
                                "type": "string",
                                "maxLength": 2000,
                                "pattern": "^(https:\\/\\/|mailto:)[^\\s\"'<>]+$"
                              }
                            },
                            "required": [
                              "id",
                              "kind",
                              "src",
                              "alt"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
                              },
                              "kind": {
                                "type": "string",
                                "const": "button"
                              },
                              "label": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 80
                              },
                              "href": {
                                "type": "string",
                                "maxLength": 2000,
                                "pattern": "^(https:\\/\\/|mailto:)[^\\s\"'<>]+$"
                              },
                              "align": {
                                "type": "string",
                                "enum": [
                                  "left",
                                  "center",
                                  "right"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "kind",
                              "label",
                              "href"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
                              },
                              "kind": {
                                "type": "string",
                                "const": "divider"
                              }
                            },
                            "required": [
                              "id",
                              "kind"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
                              },
                              "kind": {
                                "type": "string",
                                "const": "spacer"
                              },
                              "height": {
                                "type": "integer",
                                "minimum": 4,
                                "maximum": 96
                              }
                            },
                            "required": [
                              "id",
                              "kind",
                              "height"
                            ],
                            "additionalProperties": false
                          }
                        ]
                      }
                    }
                  }
                },
                "required": [
                  "id",
                  "kind",
                  "columns"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
                  },
                  "kind": {
                    "type": "string",
                    "const": "footer"
                  },
                  "text": {
                    "type": "string",
                    "maxLength": 1000
                  }
                },
                "required": [
                  "id",
                  "kind"
                ],
                "additionalProperties": false
              }
            ]
          }
        }
      },
      "required": [
        "subject",
        "blocks"
      ],
      "additionalProperties": false
    },
    "sampleContact": {
      "type": "object",
      "properties": {
        "firstName": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 120
            },
            {
              "type": "null"
            }
          ]
        },
        "lastName": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 120
            },
            {
              "type": "null"
            }
          ]
        },
        "email": {
          "type": "string",
          "maxLength": 320
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}

Effects

  • Renders HTML and text without changing state or sending email.

Interpret the response

This is a preview or validation result, not a newly discovered template identifier. Retain the input template id and inspect the preview or validation problems.

Confirm $.preview.html contains the footer links and $.preview.text is non-empty.

Exact success schema:

{
  "type": "object",
  "required": [
    "preview",
    "problems"
  ],
  "properties": {
    "preview": {
      "type": "object",
      "required": [
        "subject",
        "html",
        "text"
      ],
      "properties": {
        "subject": {
          "type": "string"
        },
        "preheader": {
          "type": "string"
        },
        "html": {
          "type": "string"
        },
        "text": {
          "type": "string"
        }
      }
    },
    "problems": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "path",
          "code",
          "message",
          "severity"
        ],
        "properties": {
          "path": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "severity": {
            "type": "string",
            "enum": [
              "error",
              "warning"
            ]
          }
        }
      }
    }
  }
}

Worked examples

Actual dispatcher and migration-created SQLite or Worker handlers; identity/workspace and external service dependencies are simulated. Fixture identifiers and timestamps are synthetic. These responses establish no live authorization, paid generation, credential provisioning or message delivery. Replace synthetic identifiers using credential-scoped discovery. A local success is not evidence of a deployed effect, configured provider or delivered message.

Successful request

Actual dispatcher and migration-created SQLite; verified identity/workspace and external CRM, Engage, Notify, Consent, Nexus, Brand, Generator, Voice and delivery dependencies are simulated. No live authorization, paid generation or external delivery is established.

Input · payload.json:

{
  "templateId": "tpl_db617df34c4f479e9f7ad8ed37d7350b"
}

CLI:

topolo actions validate app_topolo_nurture.templates.render_preview --data @payload.json --json
topolo actions plan app_topolo_nurture.templates.render_preview --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_nurture.templates.render_preview --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json

MCP tool and arguments:

{
  "tool": "topolo_read_action",
  "arguments": {
    "actionId": "app_topolo_nurture.templates.render_preview",
    "input": {
      "templateId": "tpl_db617df34c4f479e9f7ad8ed37d7350b"
    },
    "resourceType": "workspace",
    "resourceId": "<identifier returned by resource discovery>"
  }
}

Captured local response · HTTP 200:

{
  "preview": {
    "subject": "Welcome friend",
    "preheader": "Start here",
    "html": "<!DOCTYPE html>\n<html lang=\"en\" xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width,initial-scale=1\">\n<meta name=\"x-apple-disable-message-reformatting\">\n<meta name=\"color-scheme\" content=\"light dark\">\n<meta name=\"supported-color-schemes\" content=\"light dark\">\n<title>Welcome friend</title>\n<style>\n:root{color-scheme:light dark;supported-color-schemes:light dark;}\nbody{margin:0;padding:0;width:100%;-webkit-text-size-adjust:100%;}\ntable{border-collapse:collapse;}img{-ms-interpolation-mode:bicubic;}\n@media only screen and (max-width:620px){.nt-container{width:100%!important;}.nt-pad{padding-left:20px!important;padding-right:20px!important;}.nt-col{display:block!important;width:100%!important;padding:0!important;}}\n@media (prefers-color-scheme:dark){.nt-canvas{background-color:#080c16!important;}.nt-card{background-color:#0d1321!important;border-color:#2b3545!important;}.nt-text{color:#f8fafc!important;}.nt-muted{color:#94a3b8!important;}.nt-divider{border-top-color:#2b3545!important;}.nt-link.nt-accent-neutral{color:#f8fafc!important;}.nt-button.nt-accent-neutral{background-color:#f8fafc!important;}.nt-button-label.nt-accent-neutral{color:#080c16!important;}}\n[data-ogsc] .nt-canvas{background-color:#080c16!important;}[data-ogsc] .nt-card{background-color:#0d1321!important;border-color:#2b3545!important;}[data-ogsc] .nt-text{color:#f8fafc!important;}[data-ogsc] .nt-muted{color:#94a3b8!important;}[data-ogsc] .nt-divider{border-top-color:#2b3545!important;}[data-ogsc] .nt-link.nt-accent-neutral{color:#f8fafc!important;}[data-ogsc] .nt-button.nt-accent-neutral{background-color:#f8fafc!important;}[data-ogsc] .nt-button-label.nt-accent-neutral{color:#080c16!important;}\n</style>\n</head>\n<body class=\"nt-canvas\" style=\"margin:0;padding:0;background-color:#f8fafc;\">\n<div style=\"display:none;max-height:0;overflow:hidden;mso-hide:all;\">Start here&#8203;</div>\n<table role=\"presentation\" class=\"nt-canvas\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"background-color:#f8fafc;\">\n<tr><td align=\"center\" style=\"padding:24px 12px;\">\n<table role=\"presentation\" class=\"nt-container nt-card\" width=\"600\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"width:600px;max-width:600px;background-color:#ffffff;border:1px solid #e2e8f0;border-radius:8px;\">\n<tr><td style=\"height:24px;font-size:0;line-height:0;\">&nbsp;</td></tr>\n<tr><td class=\"nt-pad\" style=\"padding:0 32px 16px;\"><h1 class=\"nt-text\" style=\"margin:0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Helvetica,Arial,sans-serif;font-size:28px;line-height:1.25;font-weight:700;color:#020817;text-align:left;\">Hi there</h1></td></tr><tr><td class=\"nt-pad\" style=\"padding:24px 32px 32px;\"><div class=\"nt-footer\"><p class=\"nt-muted\" style=\"margin:0 0 8px;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Helvetica,Arial,sans-serif;font-size:12px;line-height:1.5;color:#475569;\"><a href=\"#unsubscribe\" class=\"nt-muted\" style=\"color:#475569;text-decoration:underline;\">Unsubscribe</a> &middot; <a href=\"#preferences\" class=\"nt-muted\" style=\"color:#475569;text-decoration:underline;\">Manage preferences</a></p></div></td></tr>\n</table>\n</td></tr>\n</table>\n</body>\n</html>",
    "text": "HI THERE\n\nUnsubscribe: #unsubscribe\nManage preferences: #preferences\n"
  },
  "problems": [
    {
      "path": "brand.postalAddress",
      "code": "postal_address_missing",
      "message": "Marketing email must carry a postal address; set one on the Brand kit or the template brand settings.",
      "severity": "warning"
    }
  ]
}

HTTP 200. Confirm $.preview.html contains the footer links and $.preview.text is non-empty.

Another supported request

Actual dispatcher and migration-created SQLite; verified identity/workspace and external CRM, Engage, Notify, Consent, Nexus, Brand, Generator, Voice and delivery dependencies are simulated. No live authorization, paid generation or external delivery is established.

Input · payload.json:

{
  "templateId": "tpl_f8911996077f41e4bf7e16d189faf878",
  "version": 1
}

CLI:

topolo actions validate app_topolo_nurture.templates.render_preview --data @payload.json --json
topolo actions plan app_topolo_nurture.templates.render_preview --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_nurture.templates.render_preview --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json

MCP tool and arguments:

{
  "tool": "topolo_read_action",
  "arguments": {
    "actionId": "app_topolo_nurture.templates.render_preview",
    "input": {
      "templateId": "tpl_f8911996077f41e4bf7e16d189faf878",
      "version": 1
    },
    "resourceType": "workspace",
    "resourceId": "<identifier returned by resource discovery>"
  }
}

Captured local response · HTTP 200:

{
  "preview": {
    "subject": "s",
    "preheader": "",
    "html": "<!DOCTYPE html>\n<html lang=\"en\" xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width,initial-scale=1\">\n<meta name=\"x-apple-disable-message-reformatting\">\n<meta name=\"color-scheme\" content=\"light dark\">\n<meta name=\"supported-color-schemes\" content=\"light dark\">\n<title>s</title>\n<style>\n:root{color-scheme:light dark;supported-color-schemes:light dark;}\nbody{margin:0;padding:0;width:100%;-webkit-text-size-adjust:100%;}\ntable{border-collapse:collapse;}img{-ms-interpolation-mode:bicubic;}\n@media only screen and (max-width:620px){.nt-container{width:100%!important;}.nt-pad{padding-left:20px!important;padding-right:20px!important;}.nt-col{display:block!important;width:100%!important;padding:0!important;}}\n@media (prefers-color-scheme:dark){.nt-canvas{background-color:#080c16!important;}.nt-card{background-color:#0d1321!important;border-color:#2b3545!important;}.nt-text{color:#f8fafc!important;}.nt-muted{color:#94a3b8!important;}.nt-divider{border-top-color:#2b3545!important;}.nt-link.nt-accent-neutral{color:#f8fafc!important;}.nt-button.nt-accent-neutral{background-color:#f8fafc!important;}.nt-button-label.nt-accent-neutral{color:#080c16!important;}}\n[data-ogsc] .nt-canvas{background-color:#080c16!important;}[data-ogsc] .nt-card{background-color:#0d1321!important;border-color:#2b3545!important;}[data-ogsc] .nt-text{color:#f8fafc!important;}[data-ogsc] .nt-muted{color:#94a3b8!important;}[data-ogsc] .nt-divider{border-top-color:#2b3545!important;}[data-ogsc] .nt-link.nt-accent-neutral{color:#f8fafc!important;}[data-ogsc] .nt-button.nt-accent-neutral{background-color:#f8fafc!important;}[data-ogsc] .nt-button-label.nt-accent-neutral{color:#080c16!important;}\n</style>\n</head>\n<body class=\"nt-canvas\" style=\"margin:0;padding:0;background-color:#f8fafc;\">\n<div style=\"display:none;max-height:0;overflow:hidden;mso-hide:all;\">&#8203;</div>\n<table role=\"presentation\" class=\"nt-canvas\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"background-color:#f8fafc;\">\n<tr><td align=\"center\" style=\"padding:24px 12px;\">\n<table role=\"presentation\" class=\"nt-container nt-card\" width=\"600\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"width:600px;max-width:600px;background-color:#ffffff;border:1px solid #e2e8f0;border-radius:8px;\">\n<tr><td style=\"height:24px;font-size:0;line-height:0;\">&nbsp;</td></tr>\n<tr><td class=\"nt-pad\" style=\"padding:0 32px 16px;\"><h1 class=\"nt-text\" style=\"margin:0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Helvetica,Arial,sans-serif;font-size:28px;line-height:1.25;font-weight:700;color:#020817;text-align:left;\">Hi there</h1></td></tr><tr><td class=\"nt-pad\" style=\"padding:24px 32px 32px;\"><div class=\"nt-footer\"><p class=\"nt-muted\" style=\"margin:0 0 8px;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Helvetica,Arial,sans-serif;font-size:12px;line-height:1.5;color:#475569;\"><a href=\"#unsubscribe\" class=\"nt-muted\" style=\"color:#475569;text-decoration:underline;\">Unsubscribe</a> &middot; <a href=\"#preferences\" class=\"nt-muted\" style=\"color:#475569;text-decoration:underline;\">Manage preferences</a></p></div></td></tr>\n</table>\n</td></tr>\n</table>\n</body>\n</html>",
    "text": "HI THERE\n\nUnsubscribe: #unsubscribe\nManage preferences: #preferences\n"
  },
  "problems": [
    {
      "path": "brand.postalAddress",
      "code": "postal_address_missing",
      "message": "Marketing email must carry a postal address; set one on the Brand kit or the template brand settings.",
      "severity": "warning"
    }
  ]
}

HTTP 200. Confirm $.preview.html contains the footer links and $.preview.text is non-empty.

Refused request · template_or_draft_required

Actual dispatcher and migration-created SQLite; verified identity/workspace and external CRM, Engage, Notify, Consent, Nexus, Brand, Generator, Voice and delivery dependencies are simulated. No live authorization, paid generation or external delivery is established.

Input · payload.json:

{}

CLI:

topolo actions validate app_topolo_nurture.templates.render_preview --data @payload.json --json
topolo actions plan app_topolo_nurture.templates.render_preview --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json

Captured local response · HTTP 422:

{
  "error": {
    "code": "template_or_draft_required",
    "message": "Send templateId (optionally with version) or a draft."
  }
}

HTTP 422. Preserve the refusal details and do not claim success.

Refused request · not_found

Actual dispatcher and migration-created SQLite; verified identity/workspace and external CRM, Engage, Notify, Consent, Nexus, Brand, Generator, Voice and delivery dependencies are simulated. No live authorization, paid generation or external delivery is established.

Input · payload.json:

{
  "templateId": "tpl_5cbdece31227457b9dfb300f151232f7"
}

CLI:

topolo actions validate app_topolo_nurture.templates.render_preview --data @payload.json --json
topolo actions plan app_topolo_nurture.templates.render_preview --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json

Captured local response · HTTP 404:

{
  "error": {
    "code": "not_found",
    "message": "Template version was not found in this workspace."
  }
}

HTTP 404. Preserve the refusal details and do not claim success.

Verify the result

  • Confirm $.preview.html contains the footer links and $.preview.text is non-empty.

Errors and recovery

  • organization_required (HTTP 403): Select an organization available to the verified caller before choosing a Nurture workspace.
  • permission_denied (HTTP 403): Grant the credential the required Nurture workspace permission.
  • workspace_required (HTTP 409): Create a Nurture workspace, or pass the workspace resource context.
  • invalid_input (HTTP 422): Correct the fields named in error.details using inputSchema, then retry.
  • not_found (HTTP 404): List templates with app_topolo_nurture.templates.list; when a version is given it must exist.
  • template_or_draft_required (HTTP 422): Send templateId (optionally version) or a draft {subject, preheader?, blocks}.

Auth or gateway failures may precede this handler. Preserve the exact response shape, error string/code, request id and credential context; no synthetic fixture establishes live credential access.

Recovery boundary

This action does not change service state.

  • Validate email template: Check a saved template version or an unsaved draft for problems without saving: a missing or misplaced unsubscribe footer, duplicate block ids, unknown merge fields and unsafe inline links are errors; missing image alt text and a missing brand postal address are warnings.
  • Update email template: Change a template. Renaming changes it in place; any subject, preheader or blocks change appends a new immutable version and makes it current, so earlier versions stay readable. blocks is an ordered list of typed blocks: heading {text, level 1-3}, text {text with bold, italic and label only}, image {src https, alt, width?, href?}, button {label, href https or mailto}, divider, spacer {height}, columns {2-3 columns of the other leaf blocks}, and exactly one footer {text?} as the LAST block, which always renders the unsubscribe and preference links plus the brand footer and postal address. Raw HTML is never accepted; every value is escaped. Merge tags {{contact.firstName|fallback}}, {{contact.lastName}} and {{contact.email}} are allowed in the subject, preheader and text.

Evidence

Actual dispatcher and migration-created SQLite or Worker handlers; identity/workspace and external service dependencies are simulated. Fixture identifiers and timestamps are synthetic. These responses establish no live authorization, paid generation, credential provisioning or message delivery. Test scenario and capture digests are retained with each fixture.