/Mail POST
Overview
Create an email and send or save as draft.
Query String Parameters
This endpoint does not accept any query string parameters.
Name |
Type |
Description |
Required |
email_config
|
String
|
ID of the outbound email configuration to use when sending this email
|
True
|
to_addresses
|
Array
|
Array of name/email address pairs for the TO field, when present, only email subfield is required (not name).
|
True
|
cc_addresses
|
Array
|
Array of name/email address pairs for the CC field, when present, email subfield is required.
|
False
|
bcc_addresses
|
Array
|
Array of name/email address pairs for the BCC field, when present, email subfield is required.
|
False
|
subject
|
String
|
Subject of the email
|
False
|
html_body
|
String
|
HTML body of the email
|
False
|
text_body
|
String
|
Text body of the email
|
False
|
status
|
String
|
Indicates the status of the email - 'draft' or 'ready' (ready to be sent)
|
True
|
related
|
Object
|
Contains 'parent_type' and 'parent_id' to relate this email to (for example 'Contact' and a contact's id)
|
False
|
teams
|
Object
|
Team(s) to assign this email to. 'primary' attribute is an id string for the primary team and 'other' attribute is an array of id strings for the other teams - only primary is required
|
True
|
attachments
|
Array
|
Array of file attachments - each attachment consists of a 'type' (where the attachment came from: upload, document, or template), 'id' (of the file upload, note, document revision, etc), and 'name' (the file name)
|
False
|
{
"email_config":"abc181a2-5c05-b879-8e68-502279a8c401",
"to_addresses":[
{
"name":"John Doe",
"email":"john_doe@foo.com"
},
{
"name":"David Madison",
"email":"david_madison@bar.com"
}
],
"cc_addresses":[
{
"name":"Tom Swift",
"email":"tswift@baz.com"
}
],
"bcc_addresses":null,
"subject":"Minneapolis Convention",
"html_body":"<html><body>Hello World<\/body><\/html>",
"text_body":"Hello World"
"status":"ready",
"related": {
"type":"Contacts",
"id":"61cf0f8d-938c-c9b2-53ad-51ed7bbcf83b"
},
"teams": {
"primary": "dabec868-696c-f458-e204-50227995ab50",
"others": [
"c3094c88-c95f-2e17-4553-50227996ad20",
"abcde868-696c-f458-e704-58369095ab62"
]
},
"attachments": [
{
"type": "upload",
"id": "cfbe4551-548d-f602-b228-45387645fc12",
"name": "company_logo.jpg"
},
{
"type": "document",
"id": "876112a4-89c1-4ba7-a05a-7729a7a76818"
},
{
"type": "template",
"id": "002cfe6c-98e9-4342-bdb1-1660d0788872"
}
],
}
Result
Name |
Type |
Description |
<email record field>
|
<email record field type>
|
Returns the fields for the newly created email record.
|
Output Example
{
"team_id": "9c61c46a-a7c5-df71-481c-51d48232f820",
"team_set_id": "9c61c46a-a7c5-df71-481c-51d48232f820",
"id": "d9c165d0-8863-ba61-dc85-51ed8016c476",
"date_entered": "2013-07-22 18:57:57",
"date_modified": "2013-07-22 18:57:57",
"assigned_user_id": "1",
"assigned_user_name": "",
"modified_user_id": "1",
"modified_by_name": "admin",
"created_by": "1",
"created_by_name": "",
"deleted": 0,
"from_addr_name": "SugarCRM",
"reply_to_addr": "",
"to_addrs_names": "john_doe@foo.com, david_madison@bar.com",
"cc_addrs_names": "tswift@baz.com",
"description_html": "<html><body>Hello World<\/body><\/html>",
"description": "Hello World",
"date_sent": "2013-07-22 18:57:00",
"name": "Minneapolis Convention",
"type": "out",
"status": "sent",
"parent_type": "Contacts",
"parent_id": "61cf0f8d-938c-c9b2-53ad-51ed7bbcf83b",
}
Change Log
Version |
Change |
v11
|
Last version in which /Mail POST is available. Use /Emails POST instead.
|
v10
|
Added /Mail POST endpoint.
|