Skip to content

Import Email Content From HTML

Tool name: replace-email-editor-content-from-html

Converts HTML into a newsletter email’s drag-and-drop draft, replacing its entire body without undo. Requires the current content revision; existing content triggers a first-call refusal listing what would be lost. Add-ons, decisions and AI blocks may be lost in conversion. The body must carry the %User:Signature% placeholder or postal details and an unsubscribe link. Later changes use the block tools. Does not publish or send; publishing is publish-newsletter-email-content. For an existing editor document use replace-email-editor-content-from-document, for another email replace-email-editor-content-from-email.

Input schema

editorUrlstring, [ 12 .. 500 ] charactersrequired

Editor URL of the email, exactly as returned by get-email-editor-content

contentRevisionstring, [ 7 .. 100 ] charactersrequired

contentRevision of the read this HTML is based on; a stale one refuses the import

contentHtmlstring, [ 1 .. 10000000 ] charactersrequired

The complete HTML body; replaces the stored document entirely

replaceExistingContentnull or boolean

true to replace content the email already has; omit on the first attempt, so the answer lists what would be lost

Default:null
accountIdnull or integer, >= 1

User ID of the account; omit for the account the access token works in

Default:null
Input example
{ "editorUrl": "stringstring", "contentRevision": "strings", "contentHtml": "string", "replaceExistingContent": null, "accountId": null }

Output schema

One of:
operationstringrequired

"replaced": the stored document is a new one; "unchanged": nothing was persisted.

Enum:"replaced""unchanged"
previousContentStatusstringrequired
Enum:"draft""published""unpublished_changes"
contentStatusstringrequired
Enum:"draft""published""unpublished_changes"
emailIdintegerrequired
contentRevisionstringrequired
warningsArray of stringsrequired
editorUrlstringrequired
createdArray of objectsrequired

What this write created, with uuids: after "addRow" the row and its columns, after "addModule" the block, plus the contentRevision the next write needs. Empty when nothing was created.

nextActionstringrequired

The content action still open: "review_and_publish_content" while the stored draft is not the dispatch content.

Enum:"review_and_publish_content""none"
Output example
{ "operation": "replaced", "previousContentStatus": "draft", "contentStatus": "draft", "emailId": 0, "contentRevision": "string", "warnings": [ "string" ], "editorUrl": "string", "created": [ { "operation": 0, "type": "row", "uuid": "string", "kind": "string", "columns": [ "string" ] } ], "nextAction": "review_and_publish_content" }