curl --request PATCH \
--url https://api.hubapi.com/marketing/v3/emails/{emailId}/draft \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"activeDomain": "test.hs-sites.com",
"archived": false,
"campaign": "1b7f51a6-33c1-44d6-ba28-fe81f655dced",
"content": {
"flexAreas": {
"main": {
"boxed": false,
"isSingleColumnFullWidth": false,
"sections": [
{
"columns": [
{
"id": "column_1606761806181_0",
"widgets": [
"module_160676180617911"
],
"width": 12
}
],
"id": "section_1606761806181",
"style": {
"backgroundColor": "",
"backgroundType": "CONTENT"
}
},
{
"columns": [
{
"id": "column-0-1",
"widgets": [
"module-0-1-1"
],
"width": 12
}
],
"id": "section-0",
"style": {
"backgroundType": "CONTENT",
"paddingBottom": "40px",
"paddingTop": "40px"
}
},
{
"columns": [
{
"id": "column-1-1",
"widgets": [
"module-1-1-1"
],
"width": 12
}
],
"id": "section-1",
"style": {
"backgroundColor": "",
"backgroundType": "CONTENT",
"paddingBottom": "0px",
"paddingTop": "0px"
}
}
]
}
},
"plainTextVersion": "This is custom! View in browser ({{view_as_page_url}})\n\nHello {{ contact.firstname }},\n\nPlain text emails have minimal formatting so your reader can really focus on what you have to say. Introduce yourself and explain why you’re reaching out.\n\nEvery email should try to lead the reader to some kind of action. Use this space to describe why the reader should want to click on the link below. Put the link on its own line to really draw their eye to it.\n\nLink text\n\nNow it’s time to wrap up your email. Before your signature, thank the recipient for reading. You can also invite them to send this email to any of their colleagues who might be interested.\n\nAll the best,\n\nYour full name\n\nYour job title\n\nOther contact information\n\n{{site_settings.company_name}}, {{site_settings.company_street_address_1}}, {{site_settings.company_street_address_2}}, {{site_settings.company_city}}, {{site_settings.company_state}} {{site_settings.company_zip}}, {{site_settings.company_country}}, {{site_settings.company_phone}}\n\nUnsubscribe ({{unsubscribe_link_all}})\n\nManage preferences ({{unsubscribe_link}})",
"styleSettings": {},
"widgets": {
"module-0-1-1": {
"body": {
"css_class": "dnd-module",
"html": "<p style=\"margin-bottom:10px;\">Hello {{ contact.firstname }},<br><br>Plain text emails have minimal formatting so your reader can really focus on what you have to say. Introduce yourself and explain why you’re reaching out.</p><p style=\"margin-bottom:10px;\">Every email should try to lead the reader to some kind of action. Use this space to describe why the reader should want to click on the link below. Put the link on its own line to really draw their eye to it.</p><p style=\"margin-bottom:10px;\"><a target=\"_blank\" rel=\"noopener\">Link text</a></p><p style=\"margin-bottom:10px;\">Now it’s time to wrap up your email. Before your signature, thank the recipient for reading. You can also invite them to send this email to any of their colleagues who might be interested.</p><p style=\"margin-bottom:10px;\">All the best,<br>Your full name<br>Your job title<br>Other contact information</p>",
"i18nKey": "richText.plainText",
"path": "@hubspot/rich_text",
"schema_version": 2
},
"child_css": {},
"css": {},
"id": "module-0-1-1",
"module_id": 1155639,
"name": "module-0-1-1",
"order": 2,
"styles": {},
"type": "module"
},
"module-1-1-1": {
"body": {
"align": "center",
"css_class": "dnd-module",
"font": {
"color": "#23496d",
"font": "Arial, sans-serif",
"size": {
"units": "px",
"value": 12
}
},
"link_font": {
"color": "#00a4bd",
"font": "Helvetica,Arial,sans-serif",
"size": {
"units": "px",
"value": 12
},
"styles": {
"bold": false,
"italic": false,
"underline": true
}
},
"path": "@hubspot/email_footer",
"schema_version": 2,
"unsubscribe_link_type": "both"
},
"child_css": {},
"css": {},
"id": "module-1-1-1",
"module_id": 2869621,
"name": "module-1-1-1",
"order": 3,
"styles": {},
"type": "module"
},
"module_160676180617911": {
"body": {
"font": {
"color": "#00a4bd",
"font": "Arial, sans-serif",
"size": {
"units": "px",
"value": 12
},
"styles": {
"bold": false,
"italic": false,
"underline": true
}
},
"hs_enable_module_padding": false,
"hs_wrapper_css": {}
},
"child_css": {},
"css": {},
"id": "module_160676180617911",
"module_id": 2794854,
"name": "module_160676180617911",
"styles": {},
"type": "module"
},
"preview_text": {
"body": {
"value": ""
},
"child_css": {},
"css": {},
"id": "preview_text",
"label": "Preview Text <span class=help-text>This will be used as the preview text that displays in some email clients</span>",
"name": "preview_text",
"order": 0,
"styles": {},
"type": "text"
}
}
},
"createdAt": "2020-11-30T18:43:17.136Z",
"createdById": 3739732,
"from": {
"fromName": "Bruce Wayne",
"replyTo": "test@hubspot.com"
},
"name": "My subject",
"publishDate": "2023-11-30T18:44:20.387Z",
"sendOnPublish": true,
"state": "DRAFT",
"subcategory": "batch",
"subject": "My subject",
"subscriptionDetails": {
"officeLocationId": "5449392956"
},
"to": {
"contactIds": {},
"contactIlsLists": {
"exclude": [
1
],
"include": [
5
]
},
"suppressGraymail": true
},
"webversion": {
"expiresAt": "2020-11-30T18:44:20.387Z",
"metaDescription": "",
"redirectToPageId": 0,
"redirectToUrl": "http://www.example.org"
}
}
'import requests
url = "https://api.hubapi.com/marketing/v3/emails/{emailId}/draft"
payload = {
"activeDomain": "test.hs-sites.com",
"archived": False,
"campaign": "1b7f51a6-33c1-44d6-ba28-fe81f655dced",
"content": {
"flexAreas": { "main": {
"boxed": False,
"isSingleColumnFullWidth": False,
"sections": [
{
"columns": [
{
"id": "column_1606761806181_0",
"widgets": ["module_160676180617911"],
"width": 12
}
],
"id": "section_1606761806181",
"style": {
"backgroundColor": "",
"backgroundType": "CONTENT"
}
},
{
"columns": [
{
"id": "column-0-1",
"widgets": ["module-0-1-1"],
"width": 12
}
],
"id": "section-0",
"style": {
"backgroundType": "CONTENT",
"paddingBottom": "40px",
"paddingTop": "40px"
}
},
{
"columns": [
{
"id": "column-1-1",
"widgets": ["module-1-1-1"],
"width": 12
}
],
"id": "section-1",
"style": {
"backgroundColor": "",
"backgroundType": "CONTENT",
"paddingBottom": "0px",
"paddingTop": "0px"
}
}
]
} },
"plainTextVersion": "This is custom! View in browser ({{view_as_page_url}})
Hello {{ contact.firstname }},
Plain text emails have minimal formatting so your reader can really focus on what you have to say. Introduce yourself and explain why you’re reaching out.
Every email should try to lead the reader to some kind of action. Use this space to describe why the reader should want to click on the link below. Put the link on its own line to really draw their eye to it.
Link text
Now it’s time to wrap up your email. Before your signature, thank the recipient for reading. You can also invite them to send this email to any of their colleagues who might be interested.
All the best,
Your full name
Your job title
Other contact information
{{site_settings.company_name}}, {{site_settings.company_street_address_1}}, {{site_settings.company_street_address_2}}, {{site_settings.company_city}}, {{site_settings.company_state}} {{site_settings.company_zip}}, {{site_settings.company_country}}, {{site_settings.company_phone}}
Unsubscribe ({{unsubscribe_link_all}})
Manage preferences ({{unsubscribe_link}})",
"styleSettings": {},
"widgets": {
"module-0-1-1": {
"body": {
"css_class": "dnd-module",
"html": "<p style=\"margin-bottom:10px;\">Hello {{ contact.firstname }},<br><br>Plain text emails have minimal formatting so your reader can really focus on what you have to say. Introduce yourself and explain why you’re reaching out.</p><p style=\"margin-bottom:10px;\">Every email should try to lead the reader to some kind of action. Use this space to describe why the reader should want to click on the link below. Put the link on its own line to really draw their eye to it.</p><p style=\"margin-bottom:10px;\"><a target=\"_blank\" rel=\"noopener\">Link text</a></p><p style=\"margin-bottom:10px;\">Now it’s time to wrap up your email. Before your signature, thank the recipient for reading. You can also invite them to send this email to any of their colleagues who might be interested.</p><p style=\"margin-bottom:10px;\">All the best,<br>Your full name<br>Your job title<br>Other contact information</p>",
"i18nKey": "richText.plainText",
"path": "@hubspot/rich_text",
"schema_version": 2
},
"child_css": {},
"css": {},
"id": "module-0-1-1",
"module_id": 1155639,
"name": "module-0-1-1",
"order": 2,
"styles": {},
"type": "module"
},
"module-1-1-1": {
"body": {
"align": "center",
"css_class": "dnd-module",
"font": {
"color": "#23496d",
"font": "Arial, sans-serif",
"size": {
"units": "px",
"value": 12
}
},
"link_font": {
"color": "#00a4bd",
"font": "Helvetica,Arial,sans-serif",
"size": {
"units": "px",
"value": 12
},
"styles": {
"bold": False,
"italic": False,
"underline": True
}
},
"path": "@hubspot/email_footer",
"schema_version": 2,
"unsubscribe_link_type": "both"
},
"child_css": {},
"css": {},
"id": "module-1-1-1",
"module_id": 2869621,
"name": "module-1-1-1",
"order": 3,
"styles": {},
"type": "module"
},
"module_160676180617911": {
"body": {
"font": {
"color": "#00a4bd",
"font": "Arial, sans-serif",
"size": {
"units": "px",
"value": 12
},
"styles": {
"bold": False,
"italic": False,
"underline": True
}
},
"hs_enable_module_padding": False,
"hs_wrapper_css": {}
},
"child_css": {},
"css": {},
"id": "module_160676180617911",
"module_id": 2794854,
"name": "module_160676180617911",
"styles": {},
"type": "module"
},
"preview_text": {
"body": { "value": "" },
"child_css": {},
"css": {},
"id": "preview_text",
"label": "Preview Text <span class=help-text>This will be used as the preview text that displays in some email clients</span>",
"name": "preview_text",
"order": 0,
"styles": {},
"type": "text"
}
}
},
"createdAt": "2020-11-30T18:43:17.136Z",
"createdById": 3739732,
"from": {
"fromName": "Bruce Wayne",
"replyTo": "test@hubspot.com"
},
"name": "My subject",
"publishDate": "2023-11-30T18:44:20.387Z",
"sendOnPublish": True,
"state": "DRAFT",
"subcategory": "batch",
"subject": "My subject",
"subscriptionDetails": { "officeLocationId": "5449392956" },
"to": {
"contactIds": {},
"contactIlsLists": {
"exclude": [1],
"include": [5]
},
"suppressGraymail": True
},
"webversion": {
"expiresAt": "2020-11-30T18:44:20.387Z",
"metaDescription": "",
"redirectToPageId": 0,
"redirectToUrl": "http://www.example.org"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
activeDomain: 'test.hs-sites.com',
archived: false,
campaign: '1b7f51a6-33c1-44d6-ba28-fe81f655dced',
content: {
flexAreas: {
main: {
boxed: false,
isSingleColumnFullWidth: false,
sections: [
{
columns: [{id: 'column_1606761806181_0', widgets: ['module_160676180617911'], width: 12}],
id: 'section_1606761806181',
style: {backgroundColor: '', backgroundType: 'CONTENT'}
},
{
columns: [{id: 'column-0-1', widgets: ['module-0-1-1'], width: 12}],
id: 'section-0',
style: {backgroundType: 'CONTENT', paddingBottom: '40px', paddingTop: '40px'}
},
{
columns: [{id: 'column-1-1', widgets: ['module-1-1-1'], width: 12}],
id: 'section-1',
style: {
backgroundColor: '',
backgroundType: 'CONTENT',
paddingBottom: '0px',
paddingTop: '0px'
}
}
]
}
},
plainTextVersion: 'This is custom! View in browser ({{view_as_page_url}})\n\nHello {{ contact.firstname }},\n\nPlain text emails have minimal formatting so your reader can really focus on what you have to say. Introduce yourself and explain why you’re reaching out.\n\nEvery email should try to lead the reader to some kind of action. Use this space to describe why the reader should want to click on the link below. Put the link on its own line to really draw their eye to it.\n\nLink text\n\nNow it’s time to wrap up your email. Before your signature, thank the recipient for reading. You can also invite them to send this email to any of their colleagues who might be interested.\n\nAll the best,\n\nYour full name\n\nYour job title\n\nOther contact information\n\n{{site_settings.company_name}}, {{site_settings.company_street_address_1}}, {{site_settings.company_street_address_2}}, {{site_settings.company_city}}, {{site_settings.company_state}} {{site_settings.company_zip}}, {{site_settings.company_country}}, {{site_settings.company_phone}}\n\nUnsubscribe ({{unsubscribe_link_all}})\n\nManage preferences ({{unsubscribe_link}})',
styleSettings: {},
widgets: {
'module-0-1-1': {
body: JSON.stringify({
css_class: 'dnd-module',
html: '<p style="margin-bottom:10px;">Hello {{ contact.firstname }},<br><br>Plain text emails have minimal formatting so your reader can really focus on what you have to say. Introduce yourself and explain why you’re reaching out.</p><p style="margin-bottom:10px;">Every email should try to lead the reader to some kind of action. Use this space to describe why the reader should want to click on the link below. Put the link on its own line to really draw their eye to it.</p><p style="margin-bottom:10px;"><a target="_blank" rel="noopener">Link text</a></p><p style="margin-bottom:10px;">Now it’s time to wrap up your email. Before your signature, thank the recipient for reading. You can also invite them to send this email to any of their colleagues who might be interested.</p><p style="margin-bottom:10px;">All the best,<br>Your full name<br>Your job title<br>Other contact information</p>',
i18nKey: 'richText.plainText',
path: '@hubspot/rich_text',
schema_version: 2
}),
child_css: {},
css: {},
id: 'module-0-1-1',
module_id: 1155639,
name: 'module-0-1-1',
order: 2,
styles: {},
type: 'module'
},
'module-1-1-1': {
body: JSON.stringify({
align: 'center',
css_class: 'dnd-module',
font: {color: '#23496d', font: 'Arial, sans-serif', size: {units: 'px', value: 12}},
link_font: {
color: '#00a4bd',
font: 'Helvetica,Arial,sans-serif',
size: {units: 'px', value: 12},
styles: {bold: false, italic: false, underline: true}
},
path: '@hubspot/email_footer',
schema_version: 2,
unsubscribe_link_type: 'both'
}),
child_css: {},
css: {},
id: 'module-1-1-1',
module_id: 2869621,
name: 'module-1-1-1',
order: 3,
styles: {},
type: 'module'
},
module_160676180617911: {
body: JSON.stringify({
font: {
color: '#00a4bd',
font: 'Arial, sans-serif',
size: {units: 'px', value: 12},
styles: {bold: false, italic: false, underline: true}
},
hs_enable_module_padding: false,
hs_wrapper_css: {}
}),
child_css: {},
css: {},
id: 'module_160676180617911',
module_id: 2794854,
name: 'module_160676180617911',
styles: {},
type: 'module'
},
preview_text: {
body: JSON.stringify({value: ''}),
child_css: {},
css: {},
id: 'preview_text',
label: 'Preview Text <span class=help-text>This will be used as the preview text that displays in some email clients</span>',
name: 'preview_text',
order: 0,
styles: {},
type: 'text'
}
}
},
createdAt: '2020-11-30T18:43:17.136Z',
createdById: 3739732,
from: {fromName: 'Bruce Wayne', replyTo: 'test@hubspot.com'},
name: 'My subject',
publishDate: '2023-11-30T18:44:20.387Z',
sendOnPublish: true,
state: 'DRAFT',
subcategory: 'batch',
subject: 'My subject',
subscriptionDetails: {officeLocationId: '5449392956'},
to: {
contactIds: {},
contactIlsLists: {exclude: [1], include: [5]},
suppressGraymail: true
},
webversion: {
expiresAt: '2020-11-30T18:44:20.387Z',
metaDescription: '',
redirectToPageId: 0,
redirectToUrl: 'http://www.example.org'
}
})
};
fetch('https://api.hubapi.com/marketing/v3/emails/{emailId}/draft', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hubapi.com/marketing/v3/emails/{emailId}/draft",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'activeDomain' => 'test.hs-sites.com',
'archived' => false,
'campaign' => '1b7f51a6-33c1-44d6-ba28-fe81f655dced',
'content' => [
'flexAreas' => [
'main' => [
'boxed' => false,
'isSingleColumnFullWidth' => false,
'sections' => [
[
'columns' => [
[
'id' => 'column_1606761806181_0',
'widgets' => [
'module_160676180617911'
],
'width' => 12
]
],
'id' => 'section_1606761806181',
'style' => [
'backgroundColor' => '',
'backgroundType' => 'CONTENT'
]
],
[
'columns' => [
[
'id' => 'column-0-1',
'widgets' => [
'module-0-1-1'
],
'width' => 12
]
],
'id' => 'section-0',
'style' => [
'backgroundType' => 'CONTENT',
'paddingBottom' => '40px',
'paddingTop' => '40px'
]
],
[
'columns' => [
[
'id' => 'column-1-1',
'widgets' => [
'module-1-1-1'
],
'width' => 12
]
],
'id' => 'section-1',
'style' => [
'backgroundColor' => '',
'backgroundType' => 'CONTENT',
'paddingBottom' => '0px',
'paddingTop' => '0px'
]
]
]
]
],
'plainTextVersion' => 'This is custom! View in browser ({{view_as_page_url}})
Hello {{ contact.firstname }},
Plain text emails have minimal formatting so your reader can really focus on what you have to say. Introduce yourself and explain why you’re reaching out.
Every email should try to lead the reader to some kind of action. Use this space to describe why the reader should want to click on the link below. Put the link on its own line to really draw their eye to it.
Link text
Now it’s time to wrap up your email. Before your signature, thank the recipient for reading. You can also invite them to send this email to any of their colleagues who might be interested.
All the best,
Your full name
Your job title
Other contact information
{{site_settings.company_name}}, {{site_settings.company_street_address_1}}, {{site_settings.company_street_address_2}}, {{site_settings.company_city}}, {{site_settings.company_state}} {{site_settings.company_zip}}, {{site_settings.company_country}}, {{site_settings.company_phone}}
Unsubscribe ({{unsubscribe_link_all}})
Manage preferences ({{unsubscribe_link}})',
'styleSettings' => [
],
'widgets' => [
'module-0-1-1' => [
'body' => [
'css_class' => 'dnd-module',
'html' => '<p style="margin-bottom:10px;">Hello {{ contact.firstname }},<br><br>Plain text emails have minimal formatting so your reader can really focus on what you have to say. Introduce yourself and explain why you’re reaching out.</p><p style="margin-bottom:10px;">Every email should try to lead the reader to some kind of action. Use this space to describe why the reader should want to click on the link below. Put the link on its own line to really draw their eye to it.</p><p style="margin-bottom:10px;"><a target="_blank" rel="noopener">Link text</a></p><p style="margin-bottom:10px;">Now it’s time to wrap up your email. Before your signature, thank the recipient for reading. You can also invite them to send this email to any of their colleagues who might be interested.</p><p style="margin-bottom:10px;">All the best,<br>Your full name<br>Your job title<br>Other contact information</p>',
'i18nKey' => 'richText.plainText',
'path' => '@hubspot/rich_text',
'schema_version' => 2
],
'child_css' => [
],
'css' => [
],
'id' => 'module-0-1-1',
'module_id' => 1155639,
'name' => 'module-0-1-1',
'order' => 2,
'styles' => [
],
'type' => 'module'
],
'module-1-1-1' => [
'body' => [
'align' => 'center',
'css_class' => 'dnd-module',
'font' => [
'color' => '#23496d',
'font' => 'Arial, sans-serif',
'size' => [
'units' => 'px',
'value' => 12
]
],
'link_font' => [
'color' => '#00a4bd',
'font' => 'Helvetica,Arial,sans-serif',
'size' => [
'units' => 'px',
'value' => 12
],
'styles' => [
'bold' => false,
'italic' => false,
'underline' => true
]
],
'path' => '@hubspot/email_footer',
'schema_version' => 2,
'unsubscribe_link_type' => 'both'
],
'child_css' => [
],
'css' => [
],
'id' => 'module-1-1-1',
'module_id' => 2869621,
'name' => 'module-1-1-1',
'order' => 3,
'styles' => [
],
'type' => 'module'
],
'module_160676180617911' => [
'body' => [
'font' => [
'color' => '#00a4bd',
'font' => 'Arial, sans-serif',
'size' => [
'units' => 'px',
'value' => 12
],
'styles' => [
'bold' => false,
'italic' => false,
'underline' => true
]
],
'hs_enable_module_padding' => false,
'hs_wrapper_css' => [
]
],
'child_css' => [
],
'css' => [
],
'id' => 'module_160676180617911',
'module_id' => 2794854,
'name' => 'module_160676180617911',
'styles' => [
],
'type' => 'module'
],
'preview_text' => [
'body' => [
'value' => ''
],
'child_css' => [
],
'css' => [
],
'id' => 'preview_text',
'label' => 'Preview Text <span class=help-text>This will be used as the preview text that displays in some email clients</span>',
'name' => 'preview_text',
'order' => 0,
'styles' => [
],
'type' => 'text'
]
]
],
'createdAt' => '2020-11-30T18:43:17.136Z',
'createdById' => 3739732,
'from' => [
'fromName' => 'Bruce Wayne',
'replyTo' => 'test@hubspot.com'
],
'name' => 'My subject',
'publishDate' => '2023-11-30T18:44:20.387Z',
'sendOnPublish' => true,
'state' => 'DRAFT',
'subcategory' => 'batch',
'subject' => 'My subject',
'subscriptionDetails' => [
'officeLocationId' => '5449392956'
],
'to' => [
'contactIds' => [
],
'contactIlsLists' => [
'exclude' => [
1
],
'include' => [
5
]
],
'suppressGraymail' => true
],
'webversion' => [
'expiresAt' => '2020-11-30T18:44:20.387Z',
'metaDescription' => '',
'redirectToPageId' => 0,
'redirectToUrl' => 'http://www.example.org'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.hubapi.com/marketing/v3/emails/{emailId}/draft"
payload := strings.NewReader("{\n \"activeDomain\": \"test.hs-sites.com\",\n \"archived\": false,\n \"campaign\": \"1b7f51a6-33c1-44d6-ba28-fe81f655dced\",\n \"content\": {\n \"flexAreas\": {\n \"main\": {\n \"boxed\": false,\n \"isSingleColumnFullWidth\": false,\n \"sections\": [\n {\n \"columns\": [\n {\n \"id\": \"column_1606761806181_0\",\n \"widgets\": [\n \"module_160676180617911\"\n ],\n \"width\": 12\n }\n ],\n \"id\": \"section_1606761806181\",\n \"style\": {\n \"backgroundColor\": \"\",\n \"backgroundType\": \"CONTENT\"\n }\n },\n {\n \"columns\": [\n {\n \"id\": \"column-0-1\",\n \"widgets\": [\n \"module-0-1-1\"\n ],\n \"width\": 12\n }\n ],\n \"id\": \"section-0\",\n \"style\": {\n \"backgroundType\": \"CONTENT\",\n \"paddingBottom\": \"40px\",\n \"paddingTop\": \"40px\"\n }\n },\n {\n \"columns\": [\n {\n \"id\": \"column-1-1\",\n \"widgets\": [\n \"module-1-1-1\"\n ],\n \"width\": 12\n }\n ],\n \"id\": \"section-1\",\n \"style\": {\n \"backgroundColor\": \"\",\n \"backgroundType\": \"CONTENT\",\n \"paddingBottom\": \"0px\",\n \"paddingTop\": \"0px\"\n }\n }\n ]\n }\n },\n \"plainTextVersion\": \"This is custom! View in browser ({{view_as_page_url}})\\n\\nHello {{ contact.firstname }},\\n\\nPlain text emails have minimal formatting so your reader can really focus on what you have to say. Introduce yourself and explain why you’re reaching out.\\n\\nEvery email should try to lead the reader to some kind of action. Use this space to describe why the reader should want to click on the link below. Put the link on its own line to really draw their eye to it.\\n\\nLink text\\n\\nNow it’s time to wrap up your email. Before your signature, thank the recipient for reading. You can also invite them to send this email to any of their colleagues who might be interested.\\n\\nAll the best,\\n\\nYour full name\\n\\nYour job title\\n\\nOther contact information\\n\\n{{site_settings.company_name}}, {{site_settings.company_street_address_1}}, {{site_settings.company_street_address_2}}, {{site_settings.company_city}}, {{site_settings.company_state}} {{site_settings.company_zip}}, {{site_settings.company_country}}, {{site_settings.company_phone}}\\n\\nUnsubscribe ({{unsubscribe_link_all}})\\n\\nManage preferences ({{unsubscribe_link}})\",\n \"styleSettings\": {},\n \"widgets\": {\n \"module-0-1-1\": {\n \"body\": {\n \"css_class\": \"dnd-module\",\n \"html\": \"<p style=\\\"margin-bottom:10px;\\\">Hello {{ contact.firstname }},<br><br>Plain text emails have minimal formatting so your reader can really focus on what you have to say. Introduce yourself and explain why you’re reaching out.</p><p style=\\\"margin-bottom:10px;\\\">Every email should try to lead the reader to some kind of action. Use this space to describe why the reader should want to click on the link below. Put the link on its own line to really draw their eye to it.</p><p style=\\\"margin-bottom:10px;\\\"><a target=\\\"_blank\\\" rel=\\\"noopener\\\">Link text</a></p><p style=\\\"margin-bottom:10px;\\\">Now it’s time to wrap up your email. Before your signature, thank the recipient for reading. You can also invite them to send this email to any of their colleagues who might be interested.</p><p style=\\\"margin-bottom:10px;\\\">All the best,<br>Your full name<br>Your job title<br>Other contact information</p>\",\n \"i18nKey\": \"richText.plainText\",\n \"path\": \"@hubspot/rich_text\",\n \"schema_version\": 2\n },\n \"child_css\": {},\n \"css\": {},\n \"id\": \"module-0-1-1\",\n \"module_id\": 1155639,\n \"name\": \"module-0-1-1\",\n \"order\": 2,\n \"styles\": {},\n \"type\": \"module\"\n },\n \"module-1-1-1\": {\n \"body\": {\n \"align\": \"center\",\n \"css_class\": \"dnd-module\",\n \"font\": {\n \"color\": \"#23496d\",\n \"font\": \"Arial, sans-serif\",\n \"size\": {\n \"units\": \"px\",\n \"value\": 12\n }\n },\n \"link_font\": {\n \"color\": \"#00a4bd\",\n \"font\": \"Helvetica,Arial,sans-serif\",\n \"size\": {\n \"units\": \"px\",\n \"value\": 12\n },\n \"styles\": {\n \"bold\": false,\n \"italic\": false,\n \"underline\": true\n }\n },\n \"path\": \"@hubspot/email_footer\",\n \"schema_version\": 2,\n \"unsubscribe_link_type\": \"both\"\n },\n \"child_css\": {},\n \"css\": {},\n \"id\": \"module-1-1-1\",\n \"module_id\": 2869621,\n \"name\": \"module-1-1-1\",\n \"order\": 3,\n \"styles\": {},\n \"type\": \"module\"\n },\n \"module_160676180617911\": {\n \"body\": {\n \"font\": {\n \"color\": \"#00a4bd\",\n \"font\": \"Arial, sans-serif\",\n \"size\": {\n \"units\": \"px\",\n \"value\": 12\n },\n \"styles\": {\n \"bold\": false,\n \"italic\": false,\n \"underline\": true\n }\n },\n \"hs_enable_module_padding\": false,\n \"hs_wrapper_css\": {}\n },\n \"child_css\": {},\n \"css\": {},\n \"id\": \"module_160676180617911\",\n \"module_id\": 2794854,\n \"name\": \"module_160676180617911\",\n \"styles\": {},\n \"type\": \"module\"\n },\n \"preview_text\": {\n \"body\": {\n \"value\": \"\"\n },\n \"child_css\": {},\n \"css\": {},\n \"id\": \"preview_text\",\n \"label\": \"Preview Text <span class=help-text>This will be used as the preview text that displays in some email clients</span>\",\n \"name\": \"preview_text\",\n \"order\": 0,\n \"styles\": {},\n \"type\": \"text\"\n }\n }\n },\n \"createdAt\": \"2020-11-30T18:43:17.136Z\",\n \"createdById\": 3739732,\n \"from\": {\n \"fromName\": \"Bruce Wayne\",\n \"replyTo\": \"test@hubspot.com\"\n },\n \"name\": \"My subject\",\n \"publishDate\": \"2023-11-30T18:44:20.387Z\",\n \"sendOnPublish\": true,\n \"state\": \"DRAFT\",\n \"subcategory\": \"batch\",\n \"subject\": \"My subject\",\n \"subscriptionDetails\": {\n \"officeLocationId\": \"5449392956\"\n },\n \"to\": {\n \"contactIds\": {},\n \"contactIlsLists\": {\n \"exclude\": [\n 1\n ],\n \"include\": [\n 5\n ]\n },\n \"suppressGraymail\": true\n },\n \"webversion\": {\n \"expiresAt\": \"2020-11-30T18:44:20.387Z\",\n \"metaDescription\": \"\",\n \"redirectToPageId\": 0,\n \"redirectToUrl\": \"http://www.example.org\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.hubapi.com/marketing/v3/emails/{emailId}/draft")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"activeDomain\": \"test.hs-sites.com\",\n \"archived\": false,\n \"campaign\": \"1b7f51a6-33c1-44d6-ba28-fe81f655dced\",\n \"content\": {\n \"flexAreas\": {\n \"main\": {\n \"boxed\": false,\n \"isSingleColumnFullWidth\": false,\n \"sections\": [\n {\n \"columns\": [\n {\n \"id\": \"column_1606761806181_0\",\n \"widgets\": [\n \"module_160676180617911\"\n ],\n \"width\": 12\n }\n ],\n \"id\": \"section_1606761806181\",\n \"style\": {\n \"backgroundColor\": \"\",\n \"backgroundType\": \"CONTENT\"\n }\n },\n {\n \"columns\": [\n {\n \"id\": \"column-0-1\",\n \"widgets\": [\n \"module-0-1-1\"\n ],\n \"width\": 12\n }\n ],\n \"id\": \"section-0\",\n \"style\": {\n \"backgroundType\": \"CONTENT\",\n \"paddingBottom\": \"40px\",\n \"paddingTop\": \"40px\"\n }\n },\n {\n \"columns\": [\n {\n \"id\": \"column-1-1\",\n \"widgets\": [\n \"module-1-1-1\"\n ],\n \"width\": 12\n }\n ],\n \"id\": \"section-1\",\n \"style\": {\n \"backgroundColor\": \"\",\n \"backgroundType\": \"CONTENT\",\n \"paddingBottom\": \"0px\",\n \"paddingTop\": \"0px\"\n }\n }\n ]\n }\n },\n \"plainTextVersion\": \"This is custom! View in browser ({{view_as_page_url}})\\n\\nHello {{ contact.firstname }},\\n\\nPlain text emails have minimal formatting so your reader can really focus on what you have to say. Introduce yourself and explain why you’re reaching out.\\n\\nEvery email should try to lead the reader to some kind of action. Use this space to describe why the reader should want to click on the link below. Put the link on its own line to really draw their eye to it.\\n\\nLink text\\n\\nNow it’s time to wrap up your email. Before your signature, thank the recipient for reading. You can also invite them to send this email to any of their colleagues who might be interested.\\n\\nAll the best,\\n\\nYour full name\\n\\nYour job title\\n\\nOther contact information\\n\\n{{site_settings.company_name}}, {{site_settings.company_street_address_1}}, {{site_settings.company_street_address_2}}, {{site_settings.company_city}}, {{site_settings.company_state}} {{site_settings.company_zip}}, {{site_settings.company_country}}, {{site_settings.company_phone}}\\n\\nUnsubscribe ({{unsubscribe_link_all}})\\n\\nManage preferences ({{unsubscribe_link}})\",\n \"styleSettings\": {},\n \"widgets\": {\n \"module-0-1-1\": {\n \"body\": {\n \"css_class\": \"dnd-module\",\n \"html\": \"<p style=\\\"margin-bottom:10px;\\\">Hello {{ contact.firstname }},<br><br>Plain text emails have minimal formatting so your reader can really focus on what you have to say. Introduce yourself and explain why you’re reaching out.</p><p style=\\\"margin-bottom:10px;\\\">Every email should try to lead the reader to some kind of action. Use this space to describe why the reader should want to click on the link below. Put the link on its own line to really draw their eye to it.</p><p style=\\\"margin-bottom:10px;\\\"><a target=\\\"_blank\\\" rel=\\\"noopener\\\">Link text</a></p><p style=\\\"margin-bottom:10px;\\\">Now it’s time to wrap up your email. Before your signature, thank the recipient for reading. You can also invite them to send this email to any of their colleagues who might be interested.</p><p style=\\\"margin-bottom:10px;\\\">All the best,<br>Your full name<br>Your job title<br>Other contact information</p>\",\n \"i18nKey\": \"richText.plainText\",\n \"path\": \"@hubspot/rich_text\",\n \"schema_version\": 2\n },\n \"child_css\": {},\n \"css\": {},\n \"id\": \"module-0-1-1\",\n \"module_id\": 1155639,\n \"name\": \"module-0-1-1\",\n \"order\": 2,\n \"styles\": {},\n \"type\": \"module\"\n },\n \"module-1-1-1\": {\n \"body\": {\n \"align\": \"center\",\n \"css_class\": \"dnd-module\",\n \"font\": {\n \"color\": \"#23496d\",\n \"font\": \"Arial, sans-serif\",\n \"size\": {\n \"units\": \"px\",\n \"value\": 12\n }\n },\n \"link_font\": {\n \"color\": \"#00a4bd\",\n \"font\": \"Helvetica,Arial,sans-serif\",\n \"size\": {\n \"units\": \"px\",\n \"value\": 12\n },\n \"styles\": {\n \"bold\": false,\n \"italic\": false,\n \"underline\": true\n }\n },\n \"path\": \"@hubspot/email_footer\",\n \"schema_version\": 2,\n \"unsubscribe_link_type\": \"both\"\n },\n \"child_css\": {},\n \"css\": {},\n \"id\": \"module-1-1-1\",\n \"module_id\": 2869621,\n \"name\": \"module-1-1-1\",\n \"order\": 3,\n \"styles\": {},\n \"type\": \"module\"\n },\n \"module_160676180617911\": {\n \"body\": {\n \"font\": {\n \"color\": \"#00a4bd\",\n \"font\": \"Arial, sans-serif\",\n \"size\": {\n \"units\": \"px\",\n \"value\": 12\n },\n \"styles\": {\n \"bold\": false,\n \"italic\": false,\n \"underline\": true\n }\n },\n \"hs_enable_module_padding\": false,\n \"hs_wrapper_css\": {}\n },\n \"child_css\": {},\n \"css\": {},\n \"id\": \"module_160676180617911\",\n \"module_id\": 2794854,\n \"name\": \"module_160676180617911\",\n \"styles\": {},\n \"type\": \"module\"\n },\n \"preview_text\": {\n \"body\": {\n \"value\": \"\"\n },\n \"child_css\": {},\n \"css\": {},\n \"id\": \"preview_text\",\n \"label\": \"Preview Text <span class=help-text>This will be used as the preview text that displays in some email clients</span>\",\n \"name\": \"preview_text\",\n \"order\": 0,\n \"styles\": {},\n \"type\": \"text\"\n }\n }\n },\n \"createdAt\": \"2020-11-30T18:43:17.136Z\",\n \"createdById\": 3739732,\n \"from\": {\n \"fromName\": \"Bruce Wayne\",\n \"replyTo\": \"test@hubspot.com\"\n },\n \"name\": \"My subject\",\n \"publishDate\": \"2023-11-30T18:44:20.387Z\",\n \"sendOnPublish\": true,\n \"state\": \"DRAFT\",\n \"subcategory\": \"batch\",\n \"subject\": \"My subject\",\n \"subscriptionDetails\": {\n \"officeLocationId\": \"5449392956\"\n },\n \"to\": {\n \"contactIds\": {},\n \"contactIlsLists\": {\n \"exclude\": [\n 1\n ],\n \"include\": [\n 5\n ]\n },\n \"suppressGraymail\": true\n },\n \"webversion\": {\n \"expiresAt\": \"2020-11-30T18:44:20.387Z\",\n \"metaDescription\": \"\",\n \"redirectToPageId\": 0,\n \"redirectToUrl\": \"http://www.example.org\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hubapi.com/marketing/v3/emails/{emailId}/draft")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"activeDomain\": \"test.hs-sites.com\",\n \"archived\": false,\n \"campaign\": \"1b7f51a6-33c1-44d6-ba28-fe81f655dced\",\n \"content\": {\n \"flexAreas\": {\n \"main\": {\n \"boxed\": false,\n \"isSingleColumnFullWidth\": false,\n \"sections\": [\n {\n \"columns\": [\n {\n \"id\": \"column_1606761806181_0\",\n \"widgets\": [\n \"module_160676180617911\"\n ],\n \"width\": 12\n }\n ],\n \"id\": \"section_1606761806181\",\n \"style\": {\n \"backgroundColor\": \"\",\n \"backgroundType\": \"CONTENT\"\n }\n },\n {\n \"columns\": [\n {\n \"id\": \"column-0-1\",\n \"widgets\": [\n \"module-0-1-1\"\n ],\n \"width\": 12\n }\n ],\n \"id\": \"section-0\",\n \"style\": {\n \"backgroundType\": \"CONTENT\",\n \"paddingBottom\": \"40px\",\n \"paddingTop\": \"40px\"\n }\n },\n {\n \"columns\": [\n {\n \"id\": \"column-1-1\",\n \"widgets\": [\n \"module-1-1-1\"\n ],\n \"width\": 12\n }\n ],\n \"id\": \"section-1\",\n \"style\": {\n \"backgroundColor\": \"\",\n \"backgroundType\": \"CONTENT\",\n \"paddingBottom\": \"0px\",\n \"paddingTop\": \"0px\"\n }\n }\n ]\n }\n },\n \"plainTextVersion\": \"This is custom! View in browser ({{view_as_page_url}})\\n\\nHello {{ contact.firstname }},\\n\\nPlain text emails have minimal formatting so your reader can really focus on what you have to say. Introduce yourself and explain why you’re reaching out.\\n\\nEvery email should try to lead the reader to some kind of action. Use this space to describe why the reader should want to click on the link below. Put the link on its own line to really draw their eye to it.\\n\\nLink text\\n\\nNow it’s time to wrap up your email. Before your signature, thank the recipient for reading. You can also invite them to send this email to any of their colleagues who might be interested.\\n\\nAll the best,\\n\\nYour full name\\n\\nYour job title\\n\\nOther contact information\\n\\n{{site_settings.company_name}}, {{site_settings.company_street_address_1}}, {{site_settings.company_street_address_2}}, {{site_settings.company_city}}, {{site_settings.company_state}} {{site_settings.company_zip}}, {{site_settings.company_country}}, {{site_settings.company_phone}}\\n\\nUnsubscribe ({{unsubscribe_link_all}})\\n\\nManage preferences ({{unsubscribe_link}})\",\n \"styleSettings\": {},\n \"widgets\": {\n \"module-0-1-1\": {\n \"body\": {\n \"css_class\": \"dnd-module\",\n \"html\": \"<p style=\\\"margin-bottom:10px;\\\">Hello {{ contact.firstname }},<br><br>Plain text emails have minimal formatting so your reader can really focus on what you have to say. Introduce yourself and explain why you’re reaching out.</p><p style=\\\"margin-bottom:10px;\\\">Every email should try to lead the reader to some kind of action. Use this space to describe why the reader should want to click on the link below. Put the link on its own line to really draw their eye to it.</p><p style=\\\"margin-bottom:10px;\\\"><a target=\\\"_blank\\\" rel=\\\"noopener\\\">Link text</a></p><p style=\\\"margin-bottom:10px;\\\">Now it’s time to wrap up your email. Before your signature, thank the recipient for reading. You can also invite them to send this email to any of their colleagues who might be interested.</p><p style=\\\"margin-bottom:10px;\\\">All the best,<br>Your full name<br>Your job title<br>Other contact information</p>\",\n \"i18nKey\": \"richText.plainText\",\n \"path\": \"@hubspot/rich_text\",\n \"schema_version\": 2\n },\n \"child_css\": {},\n \"css\": {},\n \"id\": \"module-0-1-1\",\n \"module_id\": 1155639,\n \"name\": \"module-0-1-1\",\n \"order\": 2,\n \"styles\": {},\n \"type\": \"module\"\n },\n \"module-1-1-1\": {\n \"body\": {\n \"align\": \"center\",\n \"css_class\": \"dnd-module\",\n \"font\": {\n \"color\": \"#23496d\",\n \"font\": \"Arial, sans-serif\",\n \"size\": {\n \"units\": \"px\",\n \"value\": 12\n }\n },\n \"link_font\": {\n \"color\": \"#00a4bd\",\n \"font\": \"Helvetica,Arial,sans-serif\",\n \"size\": {\n \"units\": \"px\",\n \"value\": 12\n },\n \"styles\": {\n \"bold\": false,\n \"italic\": false,\n \"underline\": true\n }\n },\n \"path\": \"@hubspot/email_footer\",\n \"schema_version\": 2,\n \"unsubscribe_link_type\": \"both\"\n },\n \"child_css\": {},\n \"css\": {},\n \"id\": \"module-1-1-1\",\n \"module_id\": 2869621,\n \"name\": \"module-1-1-1\",\n \"order\": 3,\n \"styles\": {},\n \"type\": \"module\"\n },\n \"module_160676180617911\": {\n \"body\": {\n \"font\": {\n \"color\": \"#00a4bd\",\n \"font\": \"Arial, sans-serif\",\n \"size\": {\n \"units\": \"px\",\n \"value\": 12\n },\n \"styles\": {\n \"bold\": false,\n \"italic\": false,\n \"underline\": true\n }\n },\n \"hs_enable_module_padding\": false,\n \"hs_wrapper_css\": {}\n },\n \"child_css\": {},\n \"css\": {},\n \"id\": \"module_160676180617911\",\n \"module_id\": 2794854,\n \"name\": \"module_160676180617911\",\n \"styles\": {},\n \"type\": \"module\"\n },\n \"preview_text\": {\n \"body\": {\n \"value\": \"\"\n },\n \"child_css\": {},\n \"css\": {},\n \"id\": \"preview_text\",\n \"label\": \"Preview Text <span class=help-text>This will be used as the preview text that displays in some email clients</span>\",\n \"name\": \"preview_text\",\n \"order\": 0,\n \"styles\": {},\n \"type\": \"text\"\n }\n }\n },\n \"createdAt\": \"2020-11-30T18:43:17.136Z\",\n \"createdById\": 3739732,\n \"from\": {\n \"fromName\": \"Bruce Wayne\",\n \"replyTo\": \"test@hubspot.com\"\n },\n \"name\": \"My subject\",\n \"publishDate\": \"2023-11-30T18:44:20.387Z\",\n \"sendOnPublish\": true,\n \"state\": \"DRAFT\",\n \"subcategory\": \"batch\",\n \"subject\": \"My subject\",\n \"subscriptionDetails\": {\n \"officeLocationId\": \"5449392956\"\n },\n \"to\": {\n \"contactIds\": {},\n \"contactIlsLists\": {\n \"exclude\": [\n 1\n ],\n \"include\": [\n 5\n ]\n },\n \"suppressGraymail\": true\n },\n \"webversion\": {\n \"expiresAt\": \"2020-11-30T18:44:20.387Z\",\n \"metaDescription\": \"\",\n \"redirectToPageId\": 0,\n \"redirectToUrl\": \"http://www.example.org\"\n }\n}"
response = http.request(request)
puts response.read_body{
"activeDomain": "test.hs-sites.com",
"archived": false,
"campaign": "1b7f51a6-33c1-44d6-ba28-fe81f655dced",
"content": {
"flexAreas": {
"main": {
"boxed": false,
"isSingleColumnFullWidth": false,
"sections": [
{
"columns": [
{
"id": "column_1606761806181_0",
"widgets": [
"module_160676180617911"
],
"width": 12
}
],
"id": "section_1606761806181",
"style": {
"backgroundColor": "",
"backgroundType": "CONTENT"
}
},
{
"columns": [
{
"id": "column-0-1",
"widgets": [
"module-0-1-1"
],
"width": 12
}
],
"id": "section-0",
"style": {
"backgroundType": "CONTENT",
"paddingBottom": "40px",
"paddingTop": "40px"
}
},
{
"columns": [
{
"id": "column-1-1",
"widgets": [
"module-1-1-1"
],
"width": 12
}
],
"id": "section-1",
"style": {
"backgroundColor": "",
"backgroundType": "CONTENT",
"paddingBottom": "0px",
"paddingTop": "0px"
}
}
]
}
},
"plainTextVersion": "This is custom! View in browser ({{view_as_page_url}})\n\nHello {{ contact.firstname }},\n\nPlain text emails have minimal formatting so your reader can really focus on what you have to say. Introduce yourself and explain why you’re reaching out.\n\nEvery email should try to lead the reader to some kind of action. Use this space to describe why the reader should want to click on the link below. Put the link on its own line to really draw their eye to it.\n\nLink text\n\nNow it’s time to wrap up your email. Before your signature, thank the recipient for reading. You can also invite them to send this email to any of their colleagues who might be interested.\n\nAll the best,\n\nYour full name\n\nYour job title\n\nOther contact information\n\n{{site_settings.company_name}}, {{site_settings.company_street_address_1}}, {{site_settings.company_street_address_2}}, {{site_settings.company_city}}, {{site_settings.company_state}} {{site_settings.company_zip}}, {{site_settings.company_country}}, {{site_settings.company_phone}}\n\nUnsubscribe ({{unsubscribe_link_all}})\n\nManage preferences ({{unsubscribe_link}})",
"styleSettings": {},
"templatePath": "@hubspot/email/dnd/plain_text.html",
"widgets": {
"module-0-1-1": {
"body": {
"css_class": "dnd-module",
"html": "<p style=\"margin-bottom:10px;\">Hello {{ contact.firstname }},<br><br>Plain text emails have minimal formatting so your reader can really focus on what you have to say. Introduce yourself and explain why you’re reaching out.</p><p style=\"margin-bottom:10px;\">Every email should try to lead the reader to some kind of action. Use this space to describe why the reader should want to click on the link below. Put the link on its own line to really draw their eye to it.</p><p style=\"margin-bottom:10px;\"><a target=\"_blank\" rel=\"noopener\">Link text</a></p><p style=\"margin-bottom:10px;\">Now it’s time to wrap up your email. Before your signature, thank the recipient for reading. You can also invite them to send this email to any of their colleagues who might be interested.</p><p style=\"margin-bottom:10px;\">All the best,<br>Your full name<br>Your job title<br>Other contact information</p>",
"i18nKey": "richText.plainText",
"path": "@hubspot/rich_text",
"schema_version": 2
},
"child_css": {},
"css": {},
"id": "module-0-1-1",
"module_id": 1155639,
"name": "module-0-1-1",
"order": 2,
"styles": {},
"type": "module"
},
"module-1-1-1": {
"body": {
"align": "center",
"css_class": "dnd-module",
"font": {
"color": "#23496d",
"font": "Arial, sans-serif",
"size": {
"units": "px",
"value": 12
}
},
"link_font": {
"color": "#00a4bd",
"font": "Helvetica,Arial,sans-serif",
"size": {
"units": "px",
"value": 12
},
"styles": {
"bold": false,
"italic": false,
"underline": true
}
},
"path": "@hubspot/email_footer",
"schema_version": 2,
"unsubscribe_link_type": "both"
},
"child_css": {},
"css": {},
"id": "module-1-1-1",
"module_id": 2869621,
"name": "module-1-1-1",
"order": 3,
"styles": {},
"type": "module"
},
"module_160676180617911": {
"body": {
"font": {
"color": "#00a4bd",
"font": "Arial, sans-serif",
"size": {
"units": "px",
"value": 12
},
"styles": {
"bold": false,
"italic": false,
"underline": true
}
},
"hs_enable_module_padding": false,
"hs_wrapper_css": {}
},
"child_css": {},
"css": {},
"id": "module_160676180617911",
"module_id": 2794854,
"name": "module_160676180617911",
"styles": {},
"type": "module"
},
"preview_text": {
"body": {
"value": ""
},
"child_css": {},
"css": {},
"id": "preview_text",
"label": "Preview Text <span class=help-text>This will be used as the preview text that displays in some email clients</span>",
"name": "preview_text",
"order": 0,
"styles": {},
"type": "text"
}
}
},
"createdAt": "2020-11-30T18:43:17.136Z",
"createdById": 3739732,
"from": {
"fromName": "Bruce Wayne",
"replyTo": "test@hubspot.com"
},
"id": "38175169118",
"isPublished": false,
"isTransactional": false,
"language": "en",
"name": "My subject",
"publishDate": "2020-11-30T18:44:20.387Z",
"sendOnPublish": true,
"state": "DRAFT",
"subcategory": "batch",
"subject": "My subject",
"subscriptionDetails": {
"officeLocationId": "5449392956"
},
"to": {
"contactIds": {},
"contactIlsLists": {
"exclude": [
1
],
"include": [
5
]
},
"suppressGraymail": true
},
"type": "BATCH_EMAIL",
"updatedAt": "2020-11-30T18:44:20.384Z",
"updatedById": 3739732,
"webversion": {
"expiresAt": "2020-11-30T18:44:20.387Z",
"metaDescription": "",
"redirectToPageId": 0,
"redirectToUrl": "http://www.example.org"
}
}{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}Update draft
マーケティングEメールの下書きバージョンを作成または更新します。下書きが存在しない場合は、現在の公開バージョンのEメールから下書きが作成され、リクエスト本文をその下書きに適用します。下書きバージョンはバッファにのみ存在し、Eメールは複製されません。
curl --request PATCH \
--url https://api.hubapi.com/marketing/v3/emails/{emailId}/draft \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"activeDomain": "test.hs-sites.com",
"archived": false,
"campaign": "1b7f51a6-33c1-44d6-ba28-fe81f655dced",
"content": {
"flexAreas": {
"main": {
"boxed": false,
"isSingleColumnFullWidth": false,
"sections": [
{
"columns": [
{
"id": "column_1606761806181_0",
"widgets": [
"module_160676180617911"
],
"width": 12
}
],
"id": "section_1606761806181",
"style": {
"backgroundColor": "",
"backgroundType": "CONTENT"
}
},
{
"columns": [
{
"id": "column-0-1",
"widgets": [
"module-0-1-1"
],
"width": 12
}
],
"id": "section-0",
"style": {
"backgroundType": "CONTENT",
"paddingBottom": "40px",
"paddingTop": "40px"
}
},
{
"columns": [
{
"id": "column-1-1",
"widgets": [
"module-1-1-1"
],
"width": 12
}
],
"id": "section-1",
"style": {
"backgroundColor": "",
"backgroundType": "CONTENT",
"paddingBottom": "0px",
"paddingTop": "0px"
}
}
]
}
},
"plainTextVersion": "This is custom! View in browser ({{view_as_page_url}})\n\nHello {{ contact.firstname }},\n\nPlain text emails have minimal formatting so your reader can really focus on what you have to say. Introduce yourself and explain why you’re reaching out.\n\nEvery email should try to lead the reader to some kind of action. Use this space to describe why the reader should want to click on the link below. Put the link on its own line to really draw their eye to it.\n\nLink text\n\nNow it’s time to wrap up your email. Before your signature, thank the recipient for reading. You can also invite them to send this email to any of their colleagues who might be interested.\n\nAll the best,\n\nYour full name\n\nYour job title\n\nOther contact information\n\n{{site_settings.company_name}}, {{site_settings.company_street_address_1}}, {{site_settings.company_street_address_2}}, {{site_settings.company_city}}, {{site_settings.company_state}} {{site_settings.company_zip}}, {{site_settings.company_country}}, {{site_settings.company_phone}}\n\nUnsubscribe ({{unsubscribe_link_all}})\n\nManage preferences ({{unsubscribe_link}})",
"styleSettings": {},
"widgets": {
"module-0-1-1": {
"body": {
"css_class": "dnd-module",
"html": "<p style=\"margin-bottom:10px;\">Hello {{ contact.firstname }},<br><br>Plain text emails have minimal formatting so your reader can really focus on what you have to say. Introduce yourself and explain why you’re reaching out.</p><p style=\"margin-bottom:10px;\">Every email should try to lead the reader to some kind of action. Use this space to describe why the reader should want to click on the link below. Put the link on its own line to really draw their eye to it.</p><p style=\"margin-bottom:10px;\"><a target=\"_blank\" rel=\"noopener\">Link text</a></p><p style=\"margin-bottom:10px;\">Now it’s time to wrap up your email. Before your signature, thank the recipient for reading. You can also invite them to send this email to any of their colleagues who might be interested.</p><p style=\"margin-bottom:10px;\">All the best,<br>Your full name<br>Your job title<br>Other contact information</p>",
"i18nKey": "richText.plainText",
"path": "@hubspot/rich_text",
"schema_version": 2
},
"child_css": {},
"css": {},
"id": "module-0-1-1",
"module_id": 1155639,
"name": "module-0-1-1",
"order": 2,
"styles": {},
"type": "module"
},
"module-1-1-1": {
"body": {
"align": "center",
"css_class": "dnd-module",
"font": {
"color": "#23496d",
"font": "Arial, sans-serif",
"size": {
"units": "px",
"value": 12
}
},
"link_font": {
"color": "#00a4bd",
"font": "Helvetica,Arial,sans-serif",
"size": {
"units": "px",
"value": 12
},
"styles": {
"bold": false,
"italic": false,
"underline": true
}
},
"path": "@hubspot/email_footer",
"schema_version": 2,
"unsubscribe_link_type": "both"
},
"child_css": {},
"css": {},
"id": "module-1-1-1",
"module_id": 2869621,
"name": "module-1-1-1",
"order": 3,
"styles": {},
"type": "module"
},
"module_160676180617911": {
"body": {
"font": {
"color": "#00a4bd",
"font": "Arial, sans-serif",
"size": {
"units": "px",
"value": 12
},
"styles": {
"bold": false,
"italic": false,
"underline": true
}
},
"hs_enable_module_padding": false,
"hs_wrapper_css": {}
},
"child_css": {},
"css": {},
"id": "module_160676180617911",
"module_id": 2794854,
"name": "module_160676180617911",
"styles": {},
"type": "module"
},
"preview_text": {
"body": {
"value": ""
},
"child_css": {},
"css": {},
"id": "preview_text",
"label": "Preview Text <span class=help-text>This will be used as the preview text that displays in some email clients</span>",
"name": "preview_text",
"order": 0,
"styles": {},
"type": "text"
}
}
},
"createdAt": "2020-11-30T18:43:17.136Z",
"createdById": 3739732,
"from": {
"fromName": "Bruce Wayne",
"replyTo": "test@hubspot.com"
},
"name": "My subject",
"publishDate": "2023-11-30T18:44:20.387Z",
"sendOnPublish": true,
"state": "DRAFT",
"subcategory": "batch",
"subject": "My subject",
"subscriptionDetails": {
"officeLocationId": "5449392956"
},
"to": {
"contactIds": {},
"contactIlsLists": {
"exclude": [
1
],
"include": [
5
]
},
"suppressGraymail": true
},
"webversion": {
"expiresAt": "2020-11-30T18:44:20.387Z",
"metaDescription": "",
"redirectToPageId": 0,
"redirectToUrl": "http://www.example.org"
}
}
'import requests
url = "https://api.hubapi.com/marketing/v3/emails/{emailId}/draft"
payload = {
"activeDomain": "test.hs-sites.com",
"archived": False,
"campaign": "1b7f51a6-33c1-44d6-ba28-fe81f655dced",
"content": {
"flexAreas": { "main": {
"boxed": False,
"isSingleColumnFullWidth": False,
"sections": [
{
"columns": [
{
"id": "column_1606761806181_0",
"widgets": ["module_160676180617911"],
"width": 12
}
],
"id": "section_1606761806181",
"style": {
"backgroundColor": "",
"backgroundType": "CONTENT"
}
},
{
"columns": [
{
"id": "column-0-1",
"widgets": ["module-0-1-1"],
"width": 12
}
],
"id": "section-0",
"style": {
"backgroundType": "CONTENT",
"paddingBottom": "40px",
"paddingTop": "40px"
}
},
{
"columns": [
{
"id": "column-1-1",
"widgets": ["module-1-1-1"],
"width": 12
}
],
"id": "section-1",
"style": {
"backgroundColor": "",
"backgroundType": "CONTENT",
"paddingBottom": "0px",
"paddingTop": "0px"
}
}
]
} },
"plainTextVersion": "This is custom! View in browser ({{view_as_page_url}})
Hello {{ contact.firstname }},
Plain text emails have minimal formatting so your reader can really focus on what you have to say. Introduce yourself and explain why you’re reaching out.
Every email should try to lead the reader to some kind of action. Use this space to describe why the reader should want to click on the link below. Put the link on its own line to really draw their eye to it.
Link text
Now it’s time to wrap up your email. Before your signature, thank the recipient for reading. You can also invite them to send this email to any of their colleagues who might be interested.
All the best,
Your full name
Your job title
Other contact information
{{site_settings.company_name}}, {{site_settings.company_street_address_1}}, {{site_settings.company_street_address_2}}, {{site_settings.company_city}}, {{site_settings.company_state}} {{site_settings.company_zip}}, {{site_settings.company_country}}, {{site_settings.company_phone}}
Unsubscribe ({{unsubscribe_link_all}})
Manage preferences ({{unsubscribe_link}})",
"styleSettings": {},
"widgets": {
"module-0-1-1": {
"body": {
"css_class": "dnd-module",
"html": "<p style=\"margin-bottom:10px;\">Hello {{ contact.firstname }},<br><br>Plain text emails have minimal formatting so your reader can really focus on what you have to say. Introduce yourself and explain why you’re reaching out.</p><p style=\"margin-bottom:10px;\">Every email should try to lead the reader to some kind of action. Use this space to describe why the reader should want to click on the link below. Put the link on its own line to really draw their eye to it.</p><p style=\"margin-bottom:10px;\"><a target=\"_blank\" rel=\"noopener\">Link text</a></p><p style=\"margin-bottom:10px;\">Now it’s time to wrap up your email. Before your signature, thank the recipient for reading. You can also invite them to send this email to any of their colleagues who might be interested.</p><p style=\"margin-bottom:10px;\">All the best,<br>Your full name<br>Your job title<br>Other contact information</p>",
"i18nKey": "richText.plainText",
"path": "@hubspot/rich_text",
"schema_version": 2
},
"child_css": {},
"css": {},
"id": "module-0-1-1",
"module_id": 1155639,
"name": "module-0-1-1",
"order": 2,
"styles": {},
"type": "module"
},
"module-1-1-1": {
"body": {
"align": "center",
"css_class": "dnd-module",
"font": {
"color": "#23496d",
"font": "Arial, sans-serif",
"size": {
"units": "px",
"value": 12
}
},
"link_font": {
"color": "#00a4bd",
"font": "Helvetica,Arial,sans-serif",
"size": {
"units": "px",
"value": 12
},
"styles": {
"bold": False,
"italic": False,
"underline": True
}
},
"path": "@hubspot/email_footer",
"schema_version": 2,
"unsubscribe_link_type": "both"
},
"child_css": {},
"css": {},
"id": "module-1-1-1",
"module_id": 2869621,
"name": "module-1-1-1",
"order": 3,
"styles": {},
"type": "module"
},
"module_160676180617911": {
"body": {
"font": {
"color": "#00a4bd",
"font": "Arial, sans-serif",
"size": {
"units": "px",
"value": 12
},
"styles": {
"bold": False,
"italic": False,
"underline": True
}
},
"hs_enable_module_padding": False,
"hs_wrapper_css": {}
},
"child_css": {},
"css": {},
"id": "module_160676180617911",
"module_id": 2794854,
"name": "module_160676180617911",
"styles": {},
"type": "module"
},
"preview_text": {
"body": { "value": "" },
"child_css": {},
"css": {},
"id": "preview_text",
"label": "Preview Text <span class=help-text>This will be used as the preview text that displays in some email clients</span>",
"name": "preview_text",
"order": 0,
"styles": {},
"type": "text"
}
}
},
"createdAt": "2020-11-30T18:43:17.136Z",
"createdById": 3739732,
"from": {
"fromName": "Bruce Wayne",
"replyTo": "test@hubspot.com"
},
"name": "My subject",
"publishDate": "2023-11-30T18:44:20.387Z",
"sendOnPublish": True,
"state": "DRAFT",
"subcategory": "batch",
"subject": "My subject",
"subscriptionDetails": { "officeLocationId": "5449392956" },
"to": {
"contactIds": {},
"contactIlsLists": {
"exclude": [1],
"include": [5]
},
"suppressGraymail": True
},
"webversion": {
"expiresAt": "2020-11-30T18:44:20.387Z",
"metaDescription": "",
"redirectToPageId": 0,
"redirectToUrl": "http://www.example.org"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
activeDomain: 'test.hs-sites.com',
archived: false,
campaign: '1b7f51a6-33c1-44d6-ba28-fe81f655dced',
content: {
flexAreas: {
main: {
boxed: false,
isSingleColumnFullWidth: false,
sections: [
{
columns: [{id: 'column_1606761806181_0', widgets: ['module_160676180617911'], width: 12}],
id: 'section_1606761806181',
style: {backgroundColor: '', backgroundType: 'CONTENT'}
},
{
columns: [{id: 'column-0-1', widgets: ['module-0-1-1'], width: 12}],
id: 'section-0',
style: {backgroundType: 'CONTENT', paddingBottom: '40px', paddingTop: '40px'}
},
{
columns: [{id: 'column-1-1', widgets: ['module-1-1-1'], width: 12}],
id: 'section-1',
style: {
backgroundColor: '',
backgroundType: 'CONTENT',
paddingBottom: '0px',
paddingTop: '0px'
}
}
]
}
},
plainTextVersion: 'This is custom! View in browser ({{view_as_page_url}})\n\nHello {{ contact.firstname }},\n\nPlain text emails have minimal formatting so your reader can really focus on what you have to say. Introduce yourself and explain why you’re reaching out.\n\nEvery email should try to lead the reader to some kind of action. Use this space to describe why the reader should want to click on the link below. Put the link on its own line to really draw their eye to it.\n\nLink text\n\nNow it’s time to wrap up your email. Before your signature, thank the recipient for reading. You can also invite them to send this email to any of their colleagues who might be interested.\n\nAll the best,\n\nYour full name\n\nYour job title\n\nOther contact information\n\n{{site_settings.company_name}}, {{site_settings.company_street_address_1}}, {{site_settings.company_street_address_2}}, {{site_settings.company_city}}, {{site_settings.company_state}} {{site_settings.company_zip}}, {{site_settings.company_country}}, {{site_settings.company_phone}}\n\nUnsubscribe ({{unsubscribe_link_all}})\n\nManage preferences ({{unsubscribe_link}})',
styleSettings: {},
widgets: {
'module-0-1-1': {
body: JSON.stringify({
css_class: 'dnd-module',
html: '<p style="margin-bottom:10px;">Hello {{ contact.firstname }},<br><br>Plain text emails have minimal formatting so your reader can really focus on what you have to say. Introduce yourself and explain why you’re reaching out.</p><p style="margin-bottom:10px;">Every email should try to lead the reader to some kind of action. Use this space to describe why the reader should want to click on the link below. Put the link on its own line to really draw their eye to it.</p><p style="margin-bottom:10px;"><a target="_blank" rel="noopener">Link text</a></p><p style="margin-bottom:10px;">Now it’s time to wrap up your email. Before your signature, thank the recipient for reading. You can also invite them to send this email to any of their colleagues who might be interested.</p><p style="margin-bottom:10px;">All the best,<br>Your full name<br>Your job title<br>Other contact information</p>',
i18nKey: 'richText.plainText',
path: '@hubspot/rich_text',
schema_version: 2
}),
child_css: {},
css: {},
id: 'module-0-1-1',
module_id: 1155639,
name: 'module-0-1-1',
order: 2,
styles: {},
type: 'module'
},
'module-1-1-1': {
body: JSON.stringify({
align: 'center',
css_class: 'dnd-module',
font: {color: '#23496d', font: 'Arial, sans-serif', size: {units: 'px', value: 12}},
link_font: {
color: '#00a4bd',
font: 'Helvetica,Arial,sans-serif',
size: {units: 'px', value: 12},
styles: {bold: false, italic: false, underline: true}
},
path: '@hubspot/email_footer',
schema_version: 2,
unsubscribe_link_type: 'both'
}),
child_css: {},
css: {},
id: 'module-1-1-1',
module_id: 2869621,
name: 'module-1-1-1',
order: 3,
styles: {},
type: 'module'
},
module_160676180617911: {
body: JSON.stringify({
font: {
color: '#00a4bd',
font: 'Arial, sans-serif',
size: {units: 'px', value: 12},
styles: {bold: false, italic: false, underline: true}
},
hs_enable_module_padding: false,
hs_wrapper_css: {}
}),
child_css: {},
css: {},
id: 'module_160676180617911',
module_id: 2794854,
name: 'module_160676180617911',
styles: {},
type: 'module'
},
preview_text: {
body: JSON.stringify({value: ''}),
child_css: {},
css: {},
id: 'preview_text',
label: 'Preview Text <span class=help-text>This will be used as the preview text that displays in some email clients</span>',
name: 'preview_text',
order: 0,
styles: {},
type: 'text'
}
}
},
createdAt: '2020-11-30T18:43:17.136Z',
createdById: 3739732,
from: {fromName: 'Bruce Wayne', replyTo: 'test@hubspot.com'},
name: 'My subject',
publishDate: '2023-11-30T18:44:20.387Z',
sendOnPublish: true,
state: 'DRAFT',
subcategory: 'batch',
subject: 'My subject',
subscriptionDetails: {officeLocationId: '5449392956'},
to: {
contactIds: {},
contactIlsLists: {exclude: [1], include: [5]},
suppressGraymail: true
},
webversion: {
expiresAt: '2020-11-30T18:44:20.387Z',
metaDescription: '',
redirectToPageId: 0,
redirectToUrl: 'http://www.example.org'
}
})
};
fetch('https://api.hubapi.com/marketing/v3/emails/{emailId}/draft', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hubapi.com/marketing/v3/emails/{emailId}/draft",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'activeDomain' => 'test.hs-sites.com',
'archived' => false,
'campaign' => '1b7f51a6-33c1-44d6-ba28-fe81f655dced',
'content' => [
'flexAreas' => [
'main' => [
'boxed' => false,
'isSingleColumnFullWidth' => false,
'sections' => [
[
'columns' => [
[
'id' => 'column_1606761806181_0',
'widgets' => [
'module_160676180617911'
],
'width' => 12
]
],
'id' => 'section_1606761806181',
'style' => [
'backgroundColor' => '',
'backgroundType' => 'CONTENT'
]
],
[
'columns' => [
[
'id' => 'column-0-1',
'widgets' => [
'module-0-1-1'
],
'width' => 12
]
],
'id' => 'section-0',
'style' => [
'backgroundType' => 'CONTENT',
'paddingBottom' => '40px',
'paddingTop' => '40px'
]
],
[
'columns' => [
[
'id' => 'column-1-1',
'widgets' => [
'module-1-1-1'
],
'width' => 12
]
],
'id' => 'section-1',
'style' => [
'backgroundColor' => '',
'backgroundType' => 'CONTENT',
'paddingBottom' => '0px',
'paddingTop' => '0px'
]
]
]
]
],
'plainTextVersion' => 'This is custom! View in browser ({{view_as_page_url}})
Hello {{ contact.firstname }},
Plain text emails have minimal formatting so your reader can really focus on what you have to say. Introduce yourself and explain why you’re reaching out.
Every email should try to lead the reader to some kind of action. Use this space to describe why the reader should want to click on the link below. Put the link on its own line to really draw their eye to it.
Link text
Now it’s time to wrap up your email. Before your signature, thank the recipient for reading. You can also invite them to send this email to any of their colleagues who might be interested.
All the best,
Your full name
Your job title
Other contact information
{{site_settings.company_name}}, {{site_settings.company_street_address_1}}, {{site_settings.company_street_address_2}}, {{site_settings.company_city}}, {{site_settings.company_state}} {{site_settings.company_zip}}, {{site_settings.company_country}}, {{site_settings.company_phone}}
Unsubscribe ({{unsubscribe_link_all}})
Manage preferences ({{unsubscribe_link}})',
'styleSettings' => [
],
'widgets' => [
'module-0-1-1' => [
'body' => [
'css_class' => 'dnd-module',
'html' => '<p style="margin-bottom:10px;">Hello {{ contact.firstname }},<br><br>Plain text emails have minimal formatting so your reader can really focus on what you have to say. Introduce yourself and explain why you’re reaching out.</p><p style="margin-bottom:10px;">Every email should try to lead the reader to some kind of action. Use this space to describe why the reader should want to click on the link below. Put the link on its own line to really draw their eye to it.</p><p style="margin-bottom:10px;"><a target="_blank" rel="noopener">Link text</a></p><p style="margin-bottom:10px;">Now it’s time to wrap up your email. Before your signature, thank the recipient for reading. You can also invite them to send this email to any of their colleagues who might be interested.</p><p style="margin-bottom:10px;">All the best,<br>Your full name<br>Your job title<br>Other contact information</p>',
'i18nKey' => 'richText.plainText',
'path' => '@hubspot/rich_text',
'schema_version' => 2
],
'child_css' => [
],
'css' => [
],
'id' => 'module-0-1-1',
'module_id' => 1155639,
'name' => 'module-0-1-1',
'order' => 2,
'styles' => [
],
'type' => 'module'
],
'module-1-1-1' => [
'body' => [
'align' => 'center',
'css_class' => 'dnd-module',
'font' => [
'color' => '#23496d',
'font' => 'Arial, sans-serif',
'size' => [
'units' => 'px',
'value' => 12
]
],
'link_font' => [
'color' => '#00a4bd',
'font' => 'Helvetica,Arial,sans-serif',
'size' => [
'units' => 'px',
'value' => 12
],
'styles' => [
'bold' => false,
'italic' => false,
'underline' => true
]
],
'path' => '@hubspot/email_footer',
'schema_version' => 2,
'unsubscribe_link_type' => 'both'
],
'child_css' => [
],
'css' => [
],
'id' => 'module-1-1-1',
'module_id' => 2869621,
'name' => 'module-1-1-1',
'order' => 3,
'styles' => [
],
'type' => 'module'
],
'module_160676180617911' => [
'body' => [
'font' => [
'color' => '#00a4bd',
'font' => 'Arial, sans-serif',
'size' => [
'units' => 'px',
'value' => 12
],
'styles' => [
'bold' => false,
'italic' => false,
'underline' => true
]
],
'hs_enable_module_padding' => false,
'hs_wrapper_css' => [
]
],
'child_css' => [
],
'css' => [
],
'id' => 'module_160676180617911',
'module_id' => 2794854,
'name' => 'module_160676180617911',
'styles' => [
],
'type' => 'module'
],
'preview_text' => [
'body' => [
'value' => ''
],
'child_css' => [
],
'css' => [
],
'id' => 'preview_text',
'label' => 'Preview Text <span class=help-text>This will be used as the preview text that displays in some email clients</span>',
'name' => 'preview_text',
'order' => 0,
'styles' => [
],
'type' => 'text'
]
]
],
'createdAt' => '2020-11-30T18:43:17.136Z',
'createdById' => 3739732,
'from' => [
'fromName' => 'Bruce Wayne',
'replyTo' => 'test@hubspot.com'
],
'name' => 'My subject',
'publishDate' => '2023-11-30T18:44:20.387Z',
'sendOnPublish' => true,
'state' => 'DRAFT',
'subcategory' => 'batch',
'subject' => 'My subject',
'subscriptionDetails' => [
'officeLocationId' => '5449392956'
],
'to' => [
'contactIds' => [
],
'contactIlsLists' => [
'exclude' => [
1
],
'include' => [
5
]
],
'suppressGraymail' => true
],
'webversion' => [
'expiresAt' => '2020-11-30T18:44:20.387Z',
'metaDescription' => '',
'redirectToPageId' => 0,
'redirectToUrl' => 'http://www.example.org'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.hubapi.com/marketing/v3/emails/{emailId}/draft"
payload := strings.NewReader("{\n \"activeDomain\": \"test.hs-sites.com\",\n \"archived\": false,\n \"campaign\": \"1b7f51a6-33c1-44d6-ba28-fe81f655dced\",\n \"content\": {\n \"flexAreas\": {\n \"main\": {\n \"boxed\": false,\n \"isSingleColumnFullWidth\": false,\n \"sections\": [\n {\n \"columns\": [\n {\n \"id\": \"column_1606761806181_0\",\n \"widgets\": [\n \"module_160676180617911\"\n ],\n \"width\": 12\n }\n ],\n \"id\": \"section_1606761806181\",\n \"style\": {\n \"backgroundColor\": \"\",\n \"backgroundType\": \"CONTENT\"\n }\n },\n {\n \"columns\": [\n {\n \"id\": \"column-0-1\",\n \"widgets\": [\n \"module-0-1-1\"\n ],\n \"width\": 12\n }\n ],\n \"id\": \"section-0\",\n \"style\": {\n \"backgroundType\": \"CONTENT\",\n \"paddingBottom\": \"40px\",\n \"paddingTop\": \"40px\"\n }\n },\n {\n \"columns\": [\n {\n \"id\": \"column-1-1\",\n \"widgets\": [\n \"module-1-1-1\"\n ],\n \"width\": 12\n }\n ],\n \"id\": \"section-1\",\n \"style\": {\n \"backgroundColor\": \"\",\n \"backgroundType\": \"CONTENT\",\n \"paddingBottom\": \"0px\",\n \"paddingTop\": \"0px\"\n }\n }\n ]\n }\n },\n \"plainTextVersion\": \"This is custom! View in browser ({{view_as_page_url}})\\n\\nHello {{ contact.firstname }},\\n\\nPlain text emails have minimal formatting so your reader can really focus on what you have to say. Introduce yourself and explain why you’re reaching out.\\n\\nEvery email should try to lead the reader to some kind of action. Use this space to describe why the reader should want to click on the link below. Put the link on its own line to really draw their eye to it.\\n\\nLink text\\n\\nNow it’s time to wrap up your email. Before your signature, thank the recipient for reading. You can also invite them to send this email to any of their colleagues who might be interested.\\n\\nAll the best,\\n\\nYour full name\\n\\nYour job title\\n\\nOther contact information\\n\\n{{site_settings.company_name}}, {{site_settings.company_street_address_1}}, {{site_settings.company_street_address_2}}, {{site_settings.company_city}}, {{site_settings.company_state}} {{site_settings.company_zip}}, {{site_settings.company_country}}, {{site_settings.company_phone}}\\n\\nUnsubscribe ({{unsubscribe_link_all}})\\n\\nManage preferences ({{unsubscribe_link}})\",\n \"styleSettings\": {},\n \"widgets\": {\n \"module-0-1-1\": {\n \"body\": {\n \"css_class\": \"dnd-module\",\n \"html\": \"<p style=\\\"margin-bottom:10px;\\\">Hello {{ contact.firstname }},<br><br>Plain text emails have minimal formatting so your reader can really focus on what you have to say. Introduce yourself and explain why you’re reaching out.</p><p style=\\\"margin-bottom:10px;\\\">Every email should try to lead the reader to some kind of action. Use this space to describe why the reader should want to click on the link below. Put the link on its own line to really draw their eye to it.</p><p style=\\\"margin-bottom:10px;\\\"><a target=\\\"_blank\\\" rel=\\\"noopener\\\">Link text</a></p><p style=\\\"margin-bottom:10px;\\\">Now it’s time to wrap up your email. Before your signature, thank the recipient for reading. You can also invite them to send this email to any of their colleagues who might be interested.</p><p style=\\\"margin-bottom:10px;\\\">All the best,<br>Your full name<br>Your job title<br>Other contact information</p>\",\n \"i18nKey\": \"richText.plainText\",\n \"path\": \"@hubspot/rich_text\",\n \"schema_version\": 2\n },\n \"child_css\": {},\n \"css\": {},\n \"id\": \"module-0-1-1\",\n \"module_id\": 1155639,\n \"name\": \"module-0-1-1\",\n \"order\": 2,\n \"styles\": {},\n \"type\": \"module\"\n },\n \"module-1-1-1\": {\n \"body\": {\n \"align\": \"center\",\n \"css_class\": \"dnd-module\",\n \"font\": {\n \"color\": \"#23496d\",\n \"font\": \"Arial, sans-serif\",\n \"size\": {\n \"units\": \"px\",\n \"value\": 12\n }\n },\n \"link_font\": {\n \"color\": \"#00a4bd\",\n \"font\": \"Helvetica,Arial,sans-serif\",\n \"size\": {\n \"units\": \"px\",\n \"value\": 12\n },\n \"styles\": {\n \"bold\": false,\n \"italic\": false,\n \"underline\": true\n }\n },\n \"path\": \"@hubspot/email_footer\",\n \"schema_version\": 2,\n \"unsubscribe_link_type\": \"both\"\n },\n \"child_css\": {},\n \"css\": {},\n \"id\": \"module-1-1-1\",\n \"module_id\": 2869621,\n \"name\": \"module-1-1-1\",\n \"order\": 3,\n \"styles\": {},\n \"type\": \"module\"\n },\n \"module_160676180617911\": {\n \"body\": {\n \"font\": {\n \"color\": \"#00a4bd\",\n \"font\": \"Arial, sans-serif\",\n \"size\": {\n \"units\": \"px\",\n \"value\": 12\n },\n \"styles\": {\n \"bold\": false,\n \"italic\": false,\n \"underline\": true\n }\n },\n \"hs_enable_module_padding\": false,\n \"hs_wrapper_css\": {}\n },\n \"child_css\": {},\n \"css\": {},\n \"id\": \"module_160676180617911\",\n \"module_id\": 2794854,\n \"name\": \"module_160676180617911\",\n \"styles\": {},\n \"type\": \"module\"\n },\n \"preview_text\": {\n \"body\": {\n \"value\": \"\"\n },\n \"child_css\": {},\n \"css\": {},\n \"id\": \"preview_text\",\n \"label\": \"Preview Text <span class=help-text>This will be used as the preview text that displays in some email clients</span>\",\n \"name\": \"preview_text\",\n \"order\": 0,\n \"styles\": {},\n \"type\": \"text\"\n }\n }\n },\n \"createdAt\": \"2020-11-30T18:43:17.136Z\",\n \"createdById\": 3739732,\n \"from\": {\n \"fromName\": \"Bruce Wayne\",\n \"replyTo\": \"test@hubspot.com\"\n },\n \"name\": \"My subject\",\n \"publishDate\": \"2023-11-30T18:44:20.387Z\",\n \"sendOnPublish\": true,\n \"state\": \"DRAFT\",\n \"subcategory\": \"batch\",\n \"subject\": \"My subject\",\n \"subscriptionDetails\": {\n \"officeLocationId\": \"5449392956\"\n },\n \"to\": {\n \"contactIds\": {},\n \"contactIlsLists\": {\n \"exclude\": [\n 1\n ],\n \"include\": [\n 5\n ]\n },\n \"suppressGraymail\": true\n },\n \"webversion\": {\n \"expiresAt\": \"2020-11-30T18:44:20.387Z\",\n \"metaDescription\": \"\",\n \"redirectToPageId\": 0,\n \"redirectToUrl\": \"http://www.example.org\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.hubapi.com/marketing/v3/emails/{emailId}/draft")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"activeDomain\": \"test.hs-sites.com\",\n \"archived\": false,\n \"campaign\": \"1b7f51a6-33c1-44d6-ba28-fe81f655dced\",\n \"content\": {\n \"flexAreas\": {\n \"main\": {\n \"boxed\": false,\n \"isSingleColumnFullWidth\": false,\n \"sections\": [\n {\n \"columns\": [\n {\n \"id\": \"column_1606761806181_0\",\n \"widgets\": [\n \"module_160676180617911\"\n ],\n \"width\": 12\n }\n ],\n \"id\": \"section_1606761806181\",\n \"style\": {\n \"backgroundColor\": \"\",\n \"backgroundType\": \"CONTENT\"\n }\n },\n {\n \"columns\": [\n {\n \"id\": \"column-0-1\",\n \"widgets\": [\n \"module-0-1-1\"\n ],\n \"width\": 12\n }\n ],\n \"id\": \"section-0\",\n \"style\": {\n \"backgroundType\": \"CONTENT\",\n \"paddingBottom\": \"40px\",\n \"paddingTop\": \"40px\"\n }\n },\n {\n \"columns\": [\n {\n \"id\": \"column-1-1\",\n \"widgets\": [\n \"module-1-1-1\"\n ],\n \"width\": 12\n }\n ],\n \"id\": \"section-1\",\n \"style\": {\n \"backgroundColor\": \"\",\n \"backgroundType\": \"CONTENT\",\n \"paddingBottom\": \"0px\",\n \"paddingTop\": \"0px\"\n }\n }\n ]\n }\n },\n \"plainTextVersion\": \"This is custom! View in browser ({{view_as_page_url}})\\n\\nHello {{ contact.firstname }},\\n\\nPlain text emails have minimal formatting so your reader can really focus on what you have to say. Introduce yourself and explain why you’re reaching out.\\n\\nEvery email should try to lead the reader to some kind of action. Use this space to describe why the reader should want to click on the link below. Put the link on its own line to really draw their eye to it.\\n\\nLink text\\n\\nNow it’s time to wrap up your email. Before your signature, thank the recipient for reading. You can also invite them to send this email to any of their colleagues who might be interested.\\n\\nAll the best,\\n\\nYour full name\\n\\nYour job title\\n\\nOther contact information\\n\\n{{site_settings.company_name}}, {{site_settings.company_street_address_1}}, {{site_settings.company_street_address_2}}, {{site_settings.company_city}}, {{site_settings.company_state}} {{site_settings.company_zip}}, {{site_settings.company_country}}, {{site_settings.company_phone}}\\n\\nUnsubscribe ({{unsubscribe_link_all}})\\n\\nManage preferences ({{unsubscribe_link}})\",\n \"styleSettings\": {},\n \"widgets\": {\n \"module-0-1-1\": {\n \"body\": {\n \"css_class\": \"dnd-module\",\n \"html\": \"<p style=\\\"margin-bottom:10px;\\\">Hello {{ contact.firstname }},<br><br>Plain text emails have minimal formatting so your reader can really focus on what you have to say. Introduce yourself and explain why you’re reaching out.</p><p style=\\\"margin-bottom:10px;\\\">Every email should try to lead the reader to some kind of action. Use this space to describe why the reader should want to click on the link below. Put the link on its own line to really draw their eye to it.</p><p style=\\\"margin-bottom:10px;\\\"><a target=\\\"_blank\\\" rel=\\\"noopener\\\">Link text</a></p><p style=\\\"margin-bottom:10px;\\\">Now it’s time to wrap up your email. Before your signature, thank the recipient for reading. You can also invite them to send this email to any of their colleagues who might be interested.</p><p style=\\\"margin-bottom:10px;\\\">All the best,<br>Your full name<br>Your job title<br>Other contact information</p>\",\n \"i18nKey\": \"richText.plainText\",\n \"path\": \"@hubspot/rich_text\",\n \"schema_version\": 2\n },\n \"child_css\": {},\n \"css\": {},\n \"id\": \"module-0-1-1\",\n \"module_id\": 1155639,\n \"name\": \"module-0-1-1\",\n \"order\": 2,\n \"styles\": {},\n \"type\": \"module\"\n },\n \"module-1-1-1\": {\n \"body\": {\n \"align\": \"center\",\n \"css_class\": \"dnd-module\",\n \"font\": {\n \"color\": \"#23496d\",\n \"font\": \"Arial, sans-serif\",\n \"size\": {\n \"units\": \"px\",\n \"value\": 12\n }\n },\n \"link_font\": {\n \"color\": \"#00a4bd\",\n \"font\": \"Helvetica,Arial,sans-serif\",\n \"size\": {\n \"units\": \"px\",\n \"value\": 12\n },\n \"styles\": {\n \"bold\": false,\n \"italic\": false,\n \"underline\": true\n }\n },\n \"path\": \"@hubspot/email_footer\",\n \"schema_version\": 2,\n \"unsubscribe_link_type\": \"both\"\n },\n \"child_css\": {},\n \"css\": {},\n \"id\": \"module-1-1-1\",\n \"module_id\": 2869621,\n \"name\": \"module-1-1-1\",\n \"order\": 3,\n \"styles\": {},\n \"type\": \"module\"\n },\n \"module_160676180617911\": {\n \"body\": {\n \"font\": {\n \"color\": \"#00a4bd\",\n \"font\": \"Arial, sans-serif\",\n \"size\": {\n \"units\": \"px\",\n \"value\": 12\n },\n \"styles\": {\n \"bold\": false,\n \"italic\": false,\n \"underline\": true\n }\n },\n \"hs_enable_module_padding\": false,\n \"hs_wrapper_css\": {}\n },\n \"child_css\": {},\n \"css\": {},\n \"id\": \"module_160676180617911\",\n \"module_id\": 2794854,\n \"name\": \"module_160676180617911\",\n \"styles\": {},\n \"type\": \"module\"\n },\n \"preview_text\": {\n \"body\": {\n \"value\": \"\"\n },\n \"child_css\": {},\n \"css\": {},\n \"id\": \"preview_text\",\n \"label\": \"Preview Text <span class=help-text>This will be used as the preview text that displays in some email clients</span>\",\n \"name\": \"preview_text\",\n \"order\": 0,\n \"styles\": {},\n \"type\": \"text\"\n }\n }\n },\n \"createdAt\": \"2020-11-30T18:43:17.136Z\",\n \"createdById\": 3739732,\n \"from\": {\n \"fromName\": \"Bruce Wayne\",\n \"replyTo\": \"test@hubspot.com\"\n },\n \"name\": \"My subject\",\n \"publishDate\": \"2023-11-30T18:44:20.387Z\",\n \"sendOnPublish\": true,\n \"state\": \"DRAFT\",\n \"subcategory\": \"batch\",\n \"subject\": \"My subject\",\n \"subscriptionDetails\": {\n \"officeLocationId\": \"5449392956\"\n },\n \"to\": {\n \"contactIds\": {},\n \"contactIlsLists\": {\n \"exclude\": [\n 1\n ],\n \"include\": [\n 5\n ]\n },\n \"suppressGraymail\": true\n },\n \"webversion\": {\n \"expiresAt\": \"2020-11-30T18:44:20.387Z\",\n \"metaDescription\": \"\",\n \"redirectToPageId\": 0,\n \"redirectToUrl\": \"http://www.example.org\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hubapi.com/marketing/v3/emails/{emailId}/draft")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"activeDomain\": \"test.hs-sites.com\",\n \"archived\": false,\n \"campaign\": \"1b7f51a6-33c1-44d6-ba28-fe81f655dced\",\n \"content\": {\n \"flexAreas\": {\n \"main\": {\n \"boxed\": false,\n \"isSingleColumnFullWidth\": false,\n \"sections\": [\n {\n \"columns\": [\n {\n \"id\": \"column_1606761806181_0\",\n \"widgets\": [\n \"module_160676180617911\"\n ],\n \"width\": 12\n }\n ],\n \"id\": \"section_1606761806181\",\n \"style\": {\n \"backgroundColor\": \"\",\n \"backgroundType\": \"CONTENT\"\n }\n },\n {\n \"columns\": [\n {\n \"id\": \"column-0-1\",\n \"widgets\": [\n \"module-0-1-1\"\n ],\n \"width\": 12\n }\n ],\n \"id\": \"section-0\",\n \"style\": {\n \"backgroundType\": \"CONTENT\",\n \"paddingBottom\": \"40px\",\n \"paddingTop\": \"40px\"\n }\n },\n {\n \"columns\": [\n {\n \"id\": \"column-1-1\",\n \"widgets\": [\n \"module-1-1-1\"\n ],\n \"width\": 12\n }\n ],\n \"id\": \"section-1\",\n \"style\": {\n \"backgroundColor\": \"\",\n \"backgroundType\": \"CONTENT\",\n \"paddingBottom\": \"0px\",\n \"paddingTop\": \"0px\"\n }\n }\n ]\n }\n },\n \"plainTextVersion\": \"This is custom! View in browser ({{view_as_page_url}})\\n\\nHello {{ contact.firstname }},\\n\\nPlain text emails have minimal formatting so your reader can really focus on what you have to say. Introduce yourself and explain why you’re reaching out.\\n\\nEvery email should try to lead the reader to some kind of action. Use this space to describe why the reader should want to click on the link below. Put the link on its own line to really draw their eye to it.\\n\\nLink text\\n\\nNow it’s time to wrap up your email. Before your signature, thank the recipient for reading. You can also invite them to send this email to any of their colleagues who might be interested.\\n\\nAll the best,\\n\\nYour full name\\n\\nYour job title\\n\\nOther contact information\\n\\n{{site_settings.company_name}}, {{site_settings.company_street_address_1}}, {{site_settings.company_street_address_2}}, {{site_settings.company_city}}, {{site_settings.company_state}} {{site_settings.company_zip}}, {{site_settings.company_country}}, {{site_settings.company_phone}}\\n\\nUnsubscribe ({{unsubscribe_link_all}})\\n\\nManage preferences ({{unsubscribe_link}})\",\n \"styleSettings\": {},\n \"widgets\": {\n \"module-0-1-1\": {\n \"body\": {\n \"css_class\": \"dnd-module\",\n \"html\": \"<p style=\\\"margin-bottom:10px;\\\">Hello {{ contact.firstname }},<br><br>Plain text emails have minimal formatting so your reader can really focus on what you have to say. Introduce yourself and explain why you’re reaching out.</p><p style=\\\"margin-bottom:10px;\\\">Every email should try to lead the reader to some kind of action. Use this space to describe why the reader should want to click on the link below. Put the link on its own line to really draw their eye to it.</p><p style=\\\"margin-bottom:10px;\\\"><a target=\\\"_blank\\\" rel=\\\"noopener\\\">Link text</a></p><p style=\\\"margin-bottom:10px;\\\">Now it’s time to wrap up your email. Before your signature, thank the recipient for reading. You can also invite them to send this email to any of their colleagues who might be interested.</p><p style=\\\"margin-bottom:10px;\\\">All the best,<br>Your full name<br>Your job title<br>Other contact information</p>\",\n \"i18nKey\": \"richText.plainText\",\n \"path\": \"@hubspot/rich_text\",\n \"schema_version\": 2\n },\n \"child_css\": {},\n \"css\": {},\n \"id\": \"module-0-1-1\",\n \"module_id\": 1155639,\n \"name\": \"module-0-1-1\",\n \"order\": 2,\n \"styles\": {},\n \"type\": \"module\"\n },\n \"module-1-1-1\": {\n \"body\": {\n \"align\": \"center\",\n \"css_class\": \"dnd-module\",\n \"font\": {\n \"color\": \"#23496d\",\n \"font\": \"Arial, sans-serif\",\n \"size\": {\n \"units\": \"px\",\n \"value\": 12\n }\n },\n \"link_font\": {\n \"color\": \"#00a4bd\",\n \"font\": \"Helvetica,Arial,sans-serif\",\n \"size\": {\n \"units\": \"px\",\n \"value\": 12\n },\n \"styles\": {\n \"bold\": false,\n \"italic\": false,\n \"underline\": true\n }\n },\n \"path\": \"@hubspot/email_footer\",\n \"schema_version\": 2,\n \"unsubscribe_link_type\": \"both\"\n },\n \"child_css\": {},\n \"css\": {},\n \"id\": \"module-1-1-1\",\n \"module_id\": 2869621,\n \"name\": \"module-1-1-1\",\n \"order\": 3,\n \"styles\": {},\n \"type\": \"module\"\n },\n \"module_160676180617911\": {\n \"body\": {\n \"font\": {\n \"color\": \"#00a4bd\",\n \"font\": \"Arial, sans-serif\",\n \"size\": {\n \"units\": \"px\",\n \"value\": 12\n },\n \"styles\": {\n \"bold\": false,\n \"italic\": false,\n \"underline\": true\n }\n },\n \"hs_enable_module_padding\": false,\n \"hs_wrapper_css\": {}\n },\n \"child_css\": {},\n \"css\": {},\n \"id\": \"module_160676180617911\",\n \"module_id\": 2794854,\n \"name\": \"module_160676180617911\",\n \"styles\": {},\n \"type\": \"module\"\n },\n \"preview_text\": {\n \"body\": {\n \"value\": \"\"\n },\n \"child_css\": {},\n \"css\": {},\n \"id\": \"preview_text\",\n \"label\": \"Preview Text <span class=help-text>This will be used as the preview text that displays in some email clients</span>\",\n \"name\": \"preview_text\",\n \"order\": 0,\n \"styles\": {},\n \"type\": \"text\"\n }\n }\n },\n \"createdAt\": \"2020-11-30T18:43:17.136Z\",\n \"createdById\": 3739732,\n \"from\": {\n \"fromName\": \"Bruce Wayne\",\n \"replyTo\": \"test@hubspot.com\"\n },\n \"name\": \"My subject\",\n \"publishDate\": \"2023-11-30T18:44:20.387Z\",\n \"sendOnPublish\": true,\n \"state\": \"DRAFT\",\n \"subcategory\": \"batch\",\n \"subject\": \"My subject\",\n \"subscriptionDetails\": {\n \"officeLocationId\": \"5449392956\"\n },\n \"to\": {\n \"contactIds\": {},\n \"contactIlsLists\": {\n \"exclude\": [\n 1\n ],\n \"include\": [\n 5\n ]\n },\n \"suppressGraymail\": true\n },\n \"webversion\": {\n \"expiresAt\": \"2020-11-30T18:44:20.387Z\",\n \"metaDescription\": \"\",\n \"redirectToPageId\": 0,\n \"redirectToUrl\": \"http://www.example.org\"\n }\n}"
response = http.request(request)
puts response.read_body{
"activeDomain": "test.hs-sites.com",
"archived": false,
"campaign": "1b7f51a6-33c1-44d6-ba28-fe81f655dced",
"content": {
"flexAreas": {
"main": {
"boxed": false,
"isSingleColumnFullWidth": false,
"sections": [
{
"columns": [
{
"id": "column_1606761806181_0",
"widgets": [
"module_160676180617911"
],
"width": 12
}
],
"id": "section_1606761806181",
"style": {
"backgroundColor": "",
"backgroundType": "CONTENT"
}
},
{
"columns": [
{
"id": "column-0-1",
"widgets": [
"module-0-1-1"
],
"width": 12
}
],
"id": "section-0",
"style": {
"backgroundType": "CONTENT",
"paddingBottom": "40px",
"paddingTop": "40px"
}
},
{
"columns": [
{
"id": "column-1-1",
"widgets": [
"module-1-1-1"
],
"width": 12
}
],
"id": "section-1",
"style": {
"backgroundColor": "",
"backgroundType": "CONTENT",
"paddingBottom": "0px",
"paddingTop": "0px"
}
}
]
}
},
"plainTextVersion": "This is custom! View in browser ({{view_as_page_url}})\n\nHello {{ contact.firstname }},\n\nPlain text emails have minimal formatting so your reader can really focus on what you have to say. Introduce yourself and explain why you’re reaching out.\n\nEvery email should try to lead the reader to some kind of action. Use this space to describe why the reader should want to click on the link below. Put the link on its own line to really draw their eye to it.\n\nLink text\n\nNow it’s time to wrap up your email. Before your signature, thank the recipient for reading. You can also invite them to send this email to any of their colleagues who might be interested.\n\nAll the best,\n\nYour full name\n\nYour job title\n\nOther contact information\n\n{{site_settings.company_name}}, {{site_settings.company_street_address_1}}, {{site_settings.company_street_address_2}}, {{site_settings.company_city}}, {{site_settings.company_state}} {{site_settings.company_zip}}, {{site_settings.company_country}}, {{site_settings.company_phone}}\n\nUnsubscribe ({{unsubscribe_link_all}})\n\nManage preferences ({{unsubscribe_link}})",
"styleSettings": {},
"templatePath": "@hubspot/email/dnd/plain_text.html",
"widgets": {
"module-0-1-1": {
"body": {
"css_class": "dnd-module",
"html": "<p style=\"margin-bottom:10px;\">Hello {{ contact.firstname }},<br><br>Plain text emails have minimal formatting so your reader can really focus on what you have to say. Introduce yourself and explain why you’re reaching out.</p><p style=\"margin-bottom:10px;\">Every email should try to lead the reader to some kind of action. Use this space to describe why the reader should want to click on the link below. Put the link on its own line to really draw their eye to it.</p><p style=\"margin-bottom:10px;\"><a target=\"_blank\" rel=\"noopener\">Link text</a></p><p style=\"margin-bottom:10px;\">Now it’s time to wrap up your email. Before your signature, thank the recipient for reading. You can also invite them to send this email to any of their colleagues who might be interested.</p><p style=\"margin-bottom:10px;\">All the best,<br>Your full name<br>Your job title<br>Other contact information</p>",
"i18nKey": "richText.plainText",
"path": "@hubspot/rich_text",
"schema_version": 2
},
"child_css": {},
"css": {},
"id": "module-0-1-1",
"module_id": 1155639,
"name": "module-0-1-1",
"order": 2,
"styles": {},
"type": "module"
},
"module-1-1-1": {
"body": {
"align": "center",
"css_class": "dnd-module",
"font": {
"color": "#23496d",
"font": "Arial, sans-serif",
"size": {
"units": "px",
"value": 12
}
},
"link_font": {
"color": "#00a4bd",
"font": "Helvetica,Arial,sans-serif",
"size": {
"units": "px",
"value": 12
},
"styles": {
"bold": false,
"italic": false,
"underline": true
}
},
"path": "@hubspot/email_footer",
"schema_version": 2,
"unsubscribe_link_type": "both"
},
"child_css": {},
"css": {},
"id": "module-1-1-1",
"module_id": 2869621,
"name": "module-1-1-1",
"order": 3,
"styles": {},
"type": "module"
},
"module_160676180617911": {
"body": {
"font": {
"color": "#00a4bd",
"font": "Arial, sans-serif",
"size": {
"units": "px",
"value": 12
},
"styles": {
"bold": false,
"italic": false,
"underline": true
}
},
"hs_enable_module_padding": false,
"hs_wrapper_css": {}
},
"child_css": {},
"css": {},
"id": "module_160676180617911",
"module_id": 2794854,
"name": "module_160676180617911",
"styles": {},
"type": "module"
},
"preview_text": {
"body": {
"value": ""
},
"child_css": {},
"css": {},
"id": "preview_text",
"label": "Preview Text <span class=help-text>This will be used as the preview text that displays in some email clients</span>",
"name": "preview_text",
"order": 0,
"styles": {},
"type": "text"
}
}
},
"createdAt": "2020-11-30T18:43:17.136Z",
"createdById": 3739732,
"from": {
"fromName": "Bruce Wayne",
"replyTo": "test@hubspot.com"
},
"id": "38175169118",
"isPublished": false,
"isTransactional": false,
"language": "en",
"name": "My subject",
"publishDate": "2020-11-30T18:44:20.387Z",
"sendOnPublish": true,
"state": "DRAFT",
"subcategory": "batch",
"subject": "My subject",
"subscriptionDetails": {
"officeLocationId": "5449392956"
},
"to": {
"contactIds": {},
"contactIlsLists": {
"exclude": [
1
],
"include": [
5
]
},
"suppressGraymail": true
},
"type": "BATCH_EMAIL",
"updatedAt": "2020-11-30T18:44:20.384Z",
"updatedById": 3739732,
"webversion": {
"expiresAt": "2020-11-30T18:44:20.387Z",
"metaDescription": "",
"redirectToPageId": 0,
"redirectToUrl": "http://www.example.org"
}
}{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}Supported products
Supported products
Required Scopes
Required Scopes
承認
The access token received from the authorization server in the OAuth 2.0 flow.
パスパラメータ
マーケティングEメールID。
ボディ
Properties of a marketing email you can update via the API.
Eメールの有効なドメイン。
Eメールがアーカイブ済みかどうかを指定します。
Eメールに関連付けられたビジネスユニットのID。
このEメールが関連付けられたキャンペーンのID。
Data structure representing the content of the email.
Show child attributes
Show child attributes
Eメールが保存されるフォルダーのID。
Data structure representing the from fields on the email.
Show child attributes
Show child attributes
全てのEメールが同時に送信されるのを防ぐ目的でEメール送信時間をランダム化するかどうかを判断します。
Eメールの言語コード(英語の場合は「en」など)。
aa, ab, ae, af, af-na, af-za, agq, agq-cm, ak, ak-gh, am, am-et, an, ann, ann-ng, ar, ar-001, ar-ae, ar-bh, ar-dj, ar-dz, ar-eg, ar-eh, ar-er, ar-il, ar-iq, ar-jo, ar-km, ar-kw, ar-lb, ar-ly, ar-ma, ar-mr, ar-om, ar-ps, ar-qa, ar-sa, ar-sd, ar-so, ar-ss, ar-sy, ar-td, ar-tn, ar-ye, as, as-in, asa, asa-tz, ast, ast-es, av, ay, az, az-az, ba, bal, bal-pk, bas, bas-cm, be, be-by, bem, bem-zm, bez, bez-tz, bg, bg-bg, bgc, bgc-in, bho, bho-in, bi, blo, blo-bj, bm, bm-ml, bn, bn-bd, bn-in, bo, bo-cn, bo-in, br, br-fr, brx, brx-in, bs, bs-ba, ca, ca-ad, ca-es, ca-fr, ca-it, ccp, ccp-bd, ccp-in, ce, ce-ru, ceb, ceb-ph, cgg, cgg-ug, ch, chr, chr-us, ckb, ckb-iq, ckb-ir, co, cr, cs, cs-cz, csw, csw-ca, cu, cu-ru, cv, cv-ru, cy, cy-gb, da, da-dk, da-gl, dav, dav-ke, de, de-at, de-be, de-ch, de-de, de-gr, de-it, de-li, de-lu, dje, dje-ne, doi, doi-in, dsb, dsb-de, dua, dua-cm, dv, dyo, dyo-sn, dz, dz-bt, ebu, ebu-ke, ee, ee-gh, ee-tg, el, el-cy, el-gr, en, en-001, en-150, en-ae, en-ag, en-ai, en-as, en-at, en-au, en-bb, en-be, en-bi, en-bm, en-bs, en-bw, en-bz, en-ca, en-cc, en-ch, en-ck, en-cm, en-cn, en-cx, en-cy, en-cz, en-de, en-dg, en-dk, en-dm, en-ee, en-eg, en-er, en-es, en-fi, en-fj, en-fk, en-fm, en-fr, en-gb, en-gd, en-gg, en-gh, en-gi, en-gm, en-gs, en-gu, en-gy, en-hk, en-hu, en-id, en-ie, en-il, en-im, en-in, en-io, en-it, en-je, en-jm, en-ke, en-ki, en-kn, en-ky, en-lc, en-lr, en-ls, en-lu, en-mg, en-mh, en-mo, en-mp, en-ms, en-mt, en-mu, en-mv, en-mw, en-mx, en-my, en-na, en-nf, en-ng, en-nl, en-no, en-nr, en-nu, en-nz, en-pg, en-ph, en-pk, en-pl, en-pn, en-pr, en-pt, en-pw, en-ro, en-rw, en-sb, en-sc, en-sd, en-se, en-sg, en-sh, en-si, en-sk, en-sl, en-ss, en-sx, en-sz, en-tc, en-th, en-tk, en-tn, en-to, en-tt, en-tv, en-tz, en-ug, en-um, en-us, en-vc, en-vg, en-vi, en-vn, en-vu, en-ws, en-za, en-zm, en-zw, eo, eo-001, es, es-419, es-ar, es-bo, es-br, es-bz, es-cl, es-co, es-cr, es-cu, es-do, es-ea, es-ec, es-es, es-gq, es-gt, es-hn, es-ic, es-mx, es-ni, es-pa, es-pe, es-ph, es-pr, es-py, es-sv, es-us, es-uy, es-ve, et, et-ee, eu, eu-es, ewo, ewo-cm, fa, fa-af, fa-ir, ff, ff-bf, ff-cm, ff-gh, ff-gm, ff-gn, ff-gw, ff-lr, ff-mr, ff-ne, ff-ng, ff-sl, ff-sn, fi, fi-fi, fil, fil-ph, fj, fo, fo-dk, fo-fo, fr, fr-be, fr-bf, fr-bi, fr-bj, fr-bl, fr-ca, fr-cd, fr-cf, fr-cg, fr-ch, fr-ci, fr-cm, fr-dj, fr-dz, fr-fr, fr-ga, fr-gf, fr-gn, fr-gp, fr-gq, fr-ht, fr-km, fr-lu, fr-ma, fr-mc, fr-mf, fr-mg, fr-ml, fr-mq, fr-mr, fr-mu, fr-nc, fr-ne, fr-pf, fr-pm, fr-re, fr-rw, fr-sc, fr-sn, fr-sy, fr-td, fr-tg, fr-tn, fr-vu, fr-wf, fr-yt, frr, frr-de, fur, fur-it, fy, fy-nl, ga, ga-gb, ga-ie, gaa, gaa-gh, gd, gd-gb, gl, gl-es, gn, gsw, gsw-ch, gsw-fr, gsw-li, gu, gu-in, guz, guz-ke, gv, gv-im, ha, ha-gh, ha-ne, ha-ng, haw, haw-us, he, he-il, hi, hi-in, hmn, ho, hr, hr-ba, hr-hr, hsb, hsb-de, ht, ht-ht, hu, hu-hu, hy, hy-am, hz, ia, ia-001, id, id-id, ie, ie-ee, ig, ig-ng, ii, ii-cn, ik, io, is, is-is, it, it-ch, it-it, it-sm, it-va, iu, ja, ja-jp, jgo, jgo-cm, jmc, jmc-tz, jv, jv-id, ka, ka-ge, kab, kab-dz, kam, kam-ke, kar, kde, kde-tz, kea, kea-cv, kg, kgp, kgp-br, kh, khq, khq-ml, ki, ki-ke, kj, kk, kk-kz, kkj, kkj-cm, kl, kl-gl, kln, kln-ke, km, km-kh, kn, kn-in, ko, ko-cn, ko-kp, ko-kr, kok, kok-in, kr, ks, ks-in, ksb, ksb-tz, ksf, ksf-cm, ksh, ksh-de, ku, ku-tr, kv, kw, kw-gb, kxv, kxv-in, ky, ky-kg, la, lag, lag-tz, lb, lb-lu, lg, lg-ug, li, lij, lij-it, lkt, lkt-us, lmo, lmo-it, ln, ln-ao, ln-cd, ln-cf, ln-cg, lo, lo-la, lrc, lrc-iq, lrc-ir, lt, lt-lt, lu, lu-cd, luo, luo-ke, luy, luy-ke, lv, lv-lv, mai, mai-in, mas, mas-ke, mas-tz, mdf, mdf-ru, mer, mer-ke, mfe, mfe-mu, mg, mg-mg, mgh, mgh-mz, mgo, mgo-cm, mh, mi, mi-nz, mk, mk-mk, ml, ml-in, mn, mn-mn, mni, mni-in, mr, mr-in, ms, ms-bn, ms-id, ms-my, ms-sg, mt, mt-mt, mua, mua-cm, my, my-mm, mzn, mzn-ir, na, naq, naq-na, nb, nb-no, nb-sj, nd, nd-zw, nds, nds-de, nds-nl, ne, ne-in, ne-np, ng, nl, nl-aw, nl-be, nl-bq, nl-ch, nl-cw, nl-lu, nl-nl, nl-sr, nl-sx, nmg, nmg-cm, nn, nn-no, nnh, nnh-cm, no, no-no, nqo, nqo-gn, nr, nso, nso-za, nus, nus-ss, nv, ny, nyn, nyn-ug, oc, oc-es, oc-fr, oj, om, om-et, om-ke, or, or-in, os, os-ge, os-ru, pa, pa-in, pa-pk, pcm, pcm-ng, pi, pis, pis-sb, pl, pl-pl, prg, prg-001, ps, ps-af, ps-pk, pt, pt-ao, pt-br, pt-ch, pt-cv, pt-gq, pt-gw, pt-lu, pt-mo, pt-mz, pt-pt, pt-st, pt-tl, qu, qu-bo, qu-ec, qu-pe, raj, raj-in, rm, rm-ch, rn, rn-bi, ro, ro-md, ro-ro, rof, rof-tz, ru, ru-by, ru-kg, ru-kz, ru-md, ru-ru, ru-ua, rw, rw-rw, rwk, rwk-tz, sa, sa-in, sah, sah-ru, saq, saq-ke, sat, sat-in, sbp, sbp-tz, sc, sc-it, sd, sd-in, sd-pk, se, se-fi, se-no, se-se, seh, seh-mz, ses, ses-ml, sg, sg-cf, shi, shi-ma, si, si-lk, sk, sk-sk, sl, sl-si, sm, smn, smn-fi, sms, sms-fi, sn, sn-zw, so, so-dj, so-et, so-ke, so-so, sq, sq-al, sq-mk, sq-xk, sr, sr-ba, sr-cs, sr-me, sr-rs, sr-xk, ss, st, st-ls, st-za, su, su-id, sv, sv-ax, sv-fi, sv-se, sw, sw-cd, sw-ke, sw-tz, sw-ug, sy, syr, syr-iq, syr-sy, szl, szl-pl, ta, ta-in, ta-lk, ta-my, ta-sg, te, te-in, teo, teo-ke, teo-ug, tg, tg-tj, th, th-th, ti, ti-er, ti-et, tk, tk-tm, tl, tn, tn-bw, tn-za, to, to-to, tok, tok-001, tr, tr-cy, tr-tr, ts, tt, tt-ru, tw, twq, twq-ne, ty, tzm, tzm-ma, ug, ug-cn, uk, uk-ua, ur, ur-in, ur-pk, uz, uz-af, uz-uz, vai, vai-lr, ve, vec, vec-it, vi, vi-vn, vmw, vmw-mz, vo, vo-001, vun, vun-tz, wa, wae, wae-ch, wo, wo-sn, xh, xh-za, xnr, xnr-in, xog, xog-ug, yav, yav-cm, yi, yi-001, yi-ua, yo, yo-bj, yo-ng, yrl, yrl-br, yrl-co, yrl-ve, yue, yue-cn, yue-hk, yue-mo, za, za-cn, zgh, zgh-ma, zh, zh-cn, zh-hans, zh-hant, zh-hk, zh-mo, zh-my, zh-sg, zh-tw, zu, zu-za Eメールダッシュボードに表示されるEメールの名前。
Eメールの予約日時(ISO8601形式)。現地時間または送信予約のEメールでのみ使用されます。
RSS related data if it is a blog or rss email.
Show child attributes
Show child attributes
Eメールを公開時にすぐに送信するかどうかを決定します。
Eメールの状態。
AGENT_GENERATED, AUTOMATED, AUTOMATED_AB, AUTOMATED_AB_VARIANT, AUTOMATED_DRAFT, AUTOMATED_DRAFT_AB, AUTOMATED_DRAFT_ABVARIANT, AUTOMATED_FOR_FORM, AUTOMATED_FOR_FORM_BUFFER, AUTOMATED_FOR_FORM_DRAFT, AUTOMATED_FOR_FORM_LEGACY, AUTOMATED_LOSER_ABVARIANT, AUTOMATED_SENDING, BLOG_EMAIL_DRAFT, BLOG_EMAIL_PUBLISHED, DRAFT, DRAFT_AB, DRAFT_AB_VARIANT, ERROR, LOSER_AB_VARIANT, PAGE_STUB, PRE_PROCESSING, PROCESSING, PUBLISHED, PUBLISHED_AB, PUBLISHED_AB_VARIANT, PUBLISHED_OR_SCHEDULED, RSS_TO_EMAIL_DRAFT, RSS_TO_EMAIL_PUBLISHED, SCHEDULED, SCHEDULED_AB, SCHEDULED_OR_PUBLISHED Eメールのサブカテゴリー。
ab_loser_variant, ab_loser_variant_site_page, ab_master, ab_master_site_page, ab_variant, ab_variant_site_page, automated, automated_ab_master, automated_ab_variant, automated_for_crm, automated_for_custom_survey, automated_for_deal, automated_for_feedback_ces, automated_for_feedback_custom, automated_for_feedback_nps, automated_for_form, automated_for_form_buffer, automated_for_form_draft, automated_for_form_legacy, automated_for_leadflow, automated_for_ticket, batch, blog_article_instance_layout, blog_article_listing, blog_author_detail, blog_email, blog_email_child, case_study, case_study_instance_layout, case_study_listing, discardable_stub, imported_blog_post, kb_404_page, kb_article_instance_layout, kb_listing, kb_search_results, kb_support_form, landing_page, legacy_blog_post, legacy_page, localtime, manage_preferences_email, marketing_single_send_api, membership_email_verification, membership_follow_up, membership_otp_login, membership_password_reset, membership_password_saved, membership_passwordless_auth, membership_registration, membership_registration_follow_up, membership_verification, normal_blog_post, optin_email, optin_followup_email, page_instance_layout, page_stub, performable_landing_page, performable_landing_page_cutover, podcast_instance_layout, podcast_listing, portal_content, resubscribe_confirmation_email, resubscribe_email, rss_to_email, rss_to_email_child, scp_instance_layout_page, scp_static_page, single_send_api, site_page, smtp_token, staged_page, ticket_closed_kickback_email, ticket_opened_kickback_email, ticket_pipeline_automated, UNKNOWN, unsubscribe_confirmation_email, web_interactive Eメールの件名。
Data structure representing the subscription fields of the email.
Show child attributes
Show child attributes
AB testing related data. This property is only returned for AB type emails.
Show child attributes
Show child attributes
Data structure representing the to fields of the email.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
レスポンス
successful operation
A marketing email
Eメールの有効なドメイン。
emailCampaignIdsのリスト。
Eメールがアーカイブ済みかどうかを指定します。
このEメールが関連付けられたキャンペーンのID。
キャンペーンの名前。
このEメールが複製されたEメールのID。
Data structure representing the content of the email.
Show child attributes
Show child attributes
Eメールの作成日時(ISO8601形式)。
Eメールを作成したユーザーのID。
Eメールが削除された日時(ISO8601表示)。
DESIGN_MANAGER, DRAG_AND_DROP EメールにリンクされているフィードバックアンケートのID。
Data structure representing the from fields on the email.
Show child attributes
Show child attributes
EメールID。
Eメールの公開ステータスを返します。読み取り専用です。
EメールがトランザクションEメールであるかどうかを返します。読み取り専用です。
aa, ab, ae, af, af-na, af-za, agq, agq-cm, ak, ak-gh, am, am-et, an, ann, ann-ng, ar, ar-001, ar-ae, ar-bh, ar-dj, ar-dz, ar-eg, ar-eh, ar-er, ar-il, ar-iq, ar-jo, ar-km, ar-kw, ar-lb, ar-ly, ar-ma, ar-mr, ar-om, ar-ps, ar-qa, ar-sa, ar-sd, ar-so, ar-ss, ar-sy, ar-td, ar-tn, ar-ye, as, as-in, asa, asa-tz, ast, ast-es, av, ay, az, az-az, ba, bal, bal-pk, bas, bas-cm, be, be-by, bem, bem-zm, bez, bez-tz, bg, bg-bg, bgc, bgc-in, bho, bho-in, bi, blo, blo-bj, bm, bm-ml, bn, bn-bd, bn-in, bo, bo-cn, bo-in, br, br-fr, brx, brx-in, bs, bs-ba, ca, ca-ad, ca-es, ca-fr, ca-it, ccp, ccp-bd, ccp-in, ce, ce-ru, ceb, ceb-ph, cgg, cgg-ug, ch, chr, chr-us, ckb, ckb-iq, ckb-ir, co, cr, cs, cs-cz, csw, csw-ca, cu, cu-ru, cv, cv-ru, cy, cy-gb, da, da-dk, da-gl, dav, dav-ke, de, de-at, de-be, de-ch, de-de, de-gr, de-it, de-li, de-lu, dje, dje-ne, doi, doi-in, dsb, dsb-de, dua, dua-cm, dv, dyo, dyo-sn, dz, dz-bt, ebu, ebu-ke, ee, ee-gh, ee-tg, el, el-cy, el-gr, en, en-001, en-150, en-ae, en-ag, en-ai, en-as, en-at, en-au, en-bb, en-be, en-bi, en-bm, en-bs, en-bw, en-bz, en-ca, en-cc, en-ch, en-ck, en-cm, en-cn, en-cx, en-cy, en-cz, en-de, en-dg, en-dk, en-dm, en-ee, en-eg, en-er, en-es, en-fi, en-fj, en-fk, en-fm, en-fr, en-gb, en-gd, en-gg, en-gh, en-gi, en-gm, en-gs, en-gu, en-gy, en-hk, en-hu, en-id, en-ie, en-il, en-im, en-in, en-io, en-it, en-je, en-jm, en-ke, en-ki, en-kn, en-ky, en-lc, en-lr, en-ls, en-lu, en-mg, en-mh, en-mo, en-mp, en-ms, en-mt, en-mu, en-mv, en-mw, en-mx, en-my, en-na, en-nf, en-ng, en-nl, en-no, en-nr, en-nu, en-nz, en-pg, en-ph, en-pk, en-pl, en-pn, en-pr, en-pt, en-pw, en-ro, en-rw, en-sb, en-sc, en-sd, en-se, en-sg, en-sh, en-si, en-sk, en-sl, en-ss, en-sx, en-sz, en-tc, en-th, en-tk, en-tn, en-to, en-tt, en-tv, en-tz, en-ug, en-um, en-us, en-vc, en-vg, en-vi, en-vn, en-vu, en-ws, en-za, en-zm, en-zw, eo, eo-001, es, es-419, es-ar, es-bo, es-br, es-bz, es-cl, es-co, es-cr, es-cu, es-do, es-ea, es-ec, es-es, es-gq, es-gt, es-hn, es-ic, es-mx, es-ni, es-pa, es-pe, es-ph, es-pr, es-py, es-sv, es-us, es-uy, es-ve, et, et-ee, eu, eu-es, ewo, ewo-cm, fa, fa-af, fa-ir, ff, ff-bf, ff-cm, ff-gh, ff-gm, ff-gn, ff-gw, ff-lr, ff-mr, ff-ne, ff-ng, ff-sl, ff-sn, fi, fi-fi, fil, fil-ph, fj, fo, fo-dk, fo-fo, fr, fr-be, fr-bf, fr-bi, fr-bj, fr-bl, fr-ca, fr-cd, fr-cf, fr-cg, fr-ch, fr-ci, fr-cm, fr-dj, fr-dz, fr-fr, fr-ga, fr-gf, fr-gn, fr-gp, fr-gq, fr-ht, fr-km, fr-lu, fr-ma, fr-mc, fr-mf, fr-mg, fr-ml, fr-mq, fr-mr, fr-mu, fr-nc, fr-ne, fr-pf, fr-pm, fr-re, fr-rw, fr-sc, fr-sn, fr-sy, fr-td, fr-tg, fr-tn, fr-vu, fr-wf, fr-yt, frr, frr-de, fur, fur-it, fy, fy-nl, ga, ga-gb, ga-ie, gaa, gaa-gh, gd, gd-gb, gl, gl-es, gn, gsw, gsw-ch, gsw-fr, gsw-li, gu, gu-in, guz, guz-ke, gv, gv-im, ha, ha-gh, ha-ne, ha-ng, haw, haw-us, he, he-il, hi, hi-in, hmn, ho, hr, hr-ba, hr-hr, hsb, hsb-de, ht, ht-ht, hu, hu-hu, hy, hy-am, hz, ia, ia-001, id, id-id, ie, ie-ee, ig, ig-ng, ii, ii-cn, ik, io, is, is-is, it, it-ch, it-it, it-sm, it-va, iu, ja, ja-jp, jgo, jgo-cm, jmc, jmc-tz, jv, jv-id, ka, ka-ge, kab, kab-dz, kam, kam-ke, kar, kde, kde-tz, kea, kea-cv, kg, kgp, kgp-br, kh, khq, khq-ml, ki, ki-ke, kj, kk, kk-kz, kkj, kkj-cm, kl, kl-gl, kln, kln-ke, km, km-kh, kn, kn-in, ko, ko-cn, ko-kp, ko-kr, kok, kok-in, kr, ks, ks-in, ksb, ksb-tz, ksf, ksf-cm, ksh, ksh-de, ku, ku-tr, kv, kw, kw-gb, kxv, kxv-in, ky, ky-kg, la, lag, lag-tz, lb, lb-lu, lg, lg-ug, li, lij, lij-it, lkt, lkt-us, lmo, lmo-it, ln, ln-ao, ln-cd, ln-cf, ln-cg, lo, lo-la, lrc, lrc-iq, lrc-ir, lt, lt-lt, lu, lu-cd, luo, luo-ke, luy, luy-ke, lv, lv-lv, mai, mai-in, mas, mas-ke, mas-tz, mdf, mdf-ru, mer, mer-ke, mfe, mfe-mu, mg, mg-mg, mgh, mgh-mz, mgo, mgo-cm, mh, mi, mi-nz, mk, mk-mk, ml, ml-in, mn, mn-mn, mni, mni-in, mr, mr-in, ms, ms-bn, ms-id, ms-my, ms-sg, mt, mt-mt, mua, mua-cm, my, my-mm, mzn, mzn-ir, na, naq, naq-na, nb, nb-no, nb-sj, nd, nd-zw, nds, nds-de, nds-nl, ne, ne-in, ne-np, ng, nl, nl-aw, nl-be, nl-bq, nl-ch, nl-cw, nl-lu, nl-nl, nl-sr, nl-sx, nmg, nmg-cm, nn, nn-no, nnh, nnh-cm, no, no-no, nqo, nqo-gn, nr, nso, nso-za, nus, nus-ss, nv, ny, nyn, nyn-ug, oc, oc-es, oc-fr, oj, om, om-et, om-ke, or, or-in, os, os-ge, os-ru, pa, pa-in, pa-pk, pcm, pcm-ng, pi, pis, pis-sb, pl, pl-pl, prg, prg-001, ps, ps-af, ps-pk, pt, pt-ao, pt-br, pt-ch, pt-cv, pt-gq, pt-gw, pt-lu, pt-mo, pt-mz, pt-pt, pt-st, pt-tl, qu, qu-bo, qu-ec, qu-pe, raj, raj-in, rm, rm-ch, rn, rn-bi, ro, ro-md, ro-ro, rof, rof-tz, ru, ru-by, ru-kg, ru-kz, ru-md, ru-ru, ru-ua, rw, rw-rw, rwk, rwk-tz, sa, sa-in, sah, sah-ru, saq, saq-ke, sat, sat-in, sbp, sbp-tz, sc, sc-it, sd, sd-in, sd-pk, se, se-fi, se-no, se-se, seh, seh-mz, ses, ses-ml, sg, sg-cf, shi, shi-ma, si, si-lk, sk, sk-sk, sl, sl-si, sm, smn, smn-fi, sms, sms-fi, sn, sn-zw, so, so-dj, so-et, so-ke, so-so, sq, sq-al, sq-mk, sq-xk, sr, sr-ba, sr-cs, sr-me, sr-rs, sr-xk, ss, st, st-ls, st-za, su, su-id, sv, sv-ax, sv-fi, sv-se, sw, sw-cd, sw-ke, sw-tz, sw-ug, sy, syr, syr-iq, syr-sy, szl, szl-pl, ta, ta-in, ta-lk, ta-my, ta-sg, te, te-in, teo, teo-ke, teo-ug, tg, tg-tj, th, th-th, ti, ti-er, ti-et, tk, tk-tm, tl, tn, tn-bw, tn-za, to, to-to, tok, tok-001, tr, tr-cy, tr-tr, ts, tt, tt-ru, tw, twq, twq-ne, ty, tzm, tzm-ma, ug, ug-cn, uk, uk-ua, ur, ur-in, ur-pk, uz, uz-af, uz-uz, vai, vai-lr, ve, vec, vec-it, vi, vi-vn, vmw, vmw-mz, vo, vo-001, vun, vun-tz, wa, wae, wae-ch, wo, wo-sn, xh, xh-za, xnr, xnr-in, xog, xog-ug, yav, yav-cm, yi, yi-001, yi-ua, yo, yo-bj, yo-ng, yrl, yrl-br, yrl-co, yrl-ve, yue, yue-cn, yue-hk, yue-mo, za, za-cn, zgh, zgh-ma, zh, zh-cn, zh-hans, zh-hant, zh-hk, zh-mo, zh-my, zh-sg, zh-tw, zu, zu-za Eメールダッシュボードに表示されるEメールの名前。
Eメールの予約日時(ISO8601形式)。現地時間または送信予約のEメールでのみ使用されます。
Eメールの公開日時(ISO8601形式)。
Eメールを公開/送信したユーザーのEメール。
Eメールを公開したユーザーのID。
Eメールを公開したユーザーの名前。
RSS related data if it is a blog or rss email.
Show child attributes
Show child attributes
Eメールを公開時にすぐに送信するかどうかを決定します。
Eメールの状態。
AGENT_GENERATED, AUTOMATED, AUTOMATED_AB, AUTOMATED_AB_VARIANT, AUTOMATED_DRAFT, AUTOMATED_DRAFT_AB, AUTOMATED_DRAFT_ABVARIANT, AUTOMATED_FOR_FORM, AUTOMATED_FOR_FORM_BUFFER, AUTOMATED_FOR_FORM_DRAFT, AUTOMATED_FOR_FORM_LEGACY, AUTOMATED_LOSER_ABVARIANT, AUTOMATED_SENDING, BLOG_EMAIL_DRAFT, BLOG_EMAIL_PUBLISHED, DRAFT, DRAFT_AB, DRAFT_AB_VARIANT, ERROR, LOSER_AB_VARIANT, PAGE_STUB, PRE_PROCESSING, PROCESSING, PUBLISHED, PUBLISHED_AB, PUBLISHED_AB_VARIANT, PUBLISHED_OR_SCHEDULED, RSS_TO_EMAIL_DRAFT, RSS_TO_EMAIL_PUBLISHED, SCHEDULED, SCHEDULED_AB, SCHEDULED_OR_PUBLISHED Show child attributes
Show child attributes
Eメールのサブカテゴリー。
Eメールの件名。
Data structure representing the subscription fields of the email.
Show child attributes
Show child attributes
AB testing related data. This property is only returned for AB type emails.
Show child attributes
Show child attributes
Data structure representing the to fields of the email.
Show child attributes
Show child attributes
Eメールの他のプロパティー(サブカテゴリーなど)から派生したEメールタイプ。
AB_EMAIL, AUTOMATED_AB_EMAIL, AUTOMATED_EMAIL, BATCH_EMAIL, BLOG_EMAIL, BLOG_EMAIL_CHILD, FEEDBACK_CES_EMAIL, FEEDBACK_CUSTOM_EMAIL, FEEDBACK_CUSTOM_SURVEY_EMAIL, FEEDBACK_NPS_EMAIL, FOLLOWUP_EMAIL, LEADFLOW_EMAIL, LOCALTIME_EMAIL, MANAGE_PREFERENCES_EMAIL, MARKETING_SINGLE_SEND_API, MEMBERSHIP_EMAIL_VERIFICATION_EMAIL, MEMBERSHIP_FOLLOW_UP_EMAIL, MEMBERSHIP_OTP_LOGIN_EMAIL, MEMBERSHIP_PASSWORD_RESET_EMAIL, MEMBERSHIP_PASSWORD_SAVED_EMAIL, MEMBERSHIP_PASSWORDLESS_AUTH_EMAIL, MEMBERSHIP_REGISTRATION_EMAIL, MEMBERSHIP_REGISTRATION_FOLLOW_UP_EMAIL, MEMBERSHIP_VERIFICATION_EMAIL, OPTIN_EMAIL, OPTIN_FOLLOWUP_EMAIL, RESUBSCRIBE_EMAIL, RSS_EMAIL, RSS_EMAIL_CHILD, SINGLE_SEND_API, SMTP_TOKEN, TICKET_EMAIL Eメールの最終更新日時(ISO8601形式)。
Eメールを最後に更新したユーザーのID。
Show child attributes
Show child attributes
「Eメールを送信」アクション内でEメールが使用されているワークフローの名前。