If you have an email that you designed with the look and feel of what you want, you can use the API to pull that which would give you the payload for the content.
The payload is listed under the “content” property for drag and drop emails and generally have two parts: sections and widgets. The sections define the sections (including columns) and the widgets are modules.
I haven’t tried it with AI but I don’t see why you couldn’t make an email template using placeholder data and then tell AI to replace the placeholder data with the content.
The payload is pretty long for a complete email so it’s a bit hard to post but here’s a sample of the content and widget code. Ids must match properly so I generally custom set the id values for the sections/columns/widgets to make it easier to navigate.
"content": {
"flexAreas": {
"main": {
"boxFirstElementIndex": 1,
"boxLastElementIndex": 11,
"boxed": true,
"isSingleColumnFullWidth": false,
"sections": [
{
"columns": [
{
"id": "column_header_1_1",
"widgets": [
"module_header_1_1_1"
],
"width": 12
}
],
"id": "section_header_1",
"style": {
"backgroundType": "CONTENT",
"paddingBottom": "0px",
"paddingTop": "0px",
"stack": "LEFT_TO_RIGHT"
}
}
]
}
},
Widgets:
"widgets": {
"module_header_1_1_1": {
"body": {
"css_class": "dnd-module",
"font": {
"color": "#000000",
"font": "Arial, sans-serif",
"size": {
"units": "px",
"value": 12
},
"styles": {
"bold": false,
"italic": false,
"underline": false
}
},
"hs_enable_module_padding": false,
"hs_wrapper_css": {},
"lineNumber": 49,
"module_id": 2794854,
"parent_widget_container": null,
"path": "@hubspot/email_web_version_link",
"schema_version": 2,
"startPosition": -176
},
"child_css": {},
"css": {},
"id": "module_header_1_1_1",
"label": null,
"module_id": 2794854,
"name": "module_header_1_1_1",
"order": 1,
"smart_type": null,
"styles": {
"breakpointStyles": {
"default": {
"hidden": false
},
"mobile": {
"hidden": false
}
}
},
"type": "module"
}
}