Skip to content

Add Email Heading

Tool name: add-email-editor-heading

Puts a heading into the column whose uuid it names and answers with the uuid of the new block. It takes text and level straight away, so a filled block is one call and one revision rather than two. The block copies the look of the nearest heading block of this email; its markup does not come with it, so start from a neighbour's, and with none to copy its text colour is the email's own default, set with update-email-editor-page-style. The level is part of the structure, not of the look: h1 is the one headline of the mail, h2 a section, h3 a subsection. A newsletter with several sections wants h2 -- that is what real ones use most. Size and colour are the markup, not the level. Bound to the contentRevision of the read and refused whole if anything in it fails, so nothing half-written is stored. Drafts only. Saves the draft; publishing is publish-newsletter-email-content.

Input schema

editorUrlstring, [ 12 .. 500 ] charactersrequired

Editor URL of the email, as the read returned it

contentRevisionstring, [ 7 .. 100 ] charactersrequired

The contentRevision of the read this change is based on

columnUuidstringrequired

The uuid of the column the block goes into

textnull or string, <= 100000 characters

The words of the heading, as markup

Default:null
levelnull or string

The heading level: "h1", "h2" or "h3"; omit for h1

Default:null
Enum:"h1""h2""h3"
positionnull or integer, >= 0

Where it goes inside the column, counted from zero; omit to append

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", "columnUuid": "string", "text": null, "level": "h1", "position": 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" }