Zoho: Send an email to a record
Zoho sendMail.sendMail: arguments, response, policy and SDK examples.
← Send mail operations · Get started
Operation zoho.sendmail
Provider route: POST /crm/v8/{moduleName}/{id}/actions/send_mail. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/zoho with npm, or alter-sdk-zoho with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { ZohoIntegration } from "@alter-ai/zoho";
async function execute(input: Parameters<ZohoIntegration["sendMail"]["sendMail"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new ZohoIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.sendMail.sendMail(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_zoho import ZohoIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = ZohoIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.send_mail.send_mail(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.moduleName | string | Required within parent | Module API name Maximum length: 100 |
path.id | string | Required within parent | Record ID Maximum length: 100 |
body | Model | Required within parent | Expand Send an email to a record — request body — body |
Referenced models: Send an email to a record — request body — body
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand Send an email to a record — response body |
Referenced models: Send an email to a record — response body
Schemas
Section titled “Schemas”Send an email to a record — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents the response returned after the email sends successfully. Additional keys: not allowed |
data | array | Optional | Represents the list of mail-send results, one item per email request. Maximum items: 10 |
data[] | object | Each item | Represents the result status for a single email send attempt. Additional keys: not allowed |
data[].code | string | Optional | Represents the status code for the send operation. Possible values: **SUCCESS** - The email was sent successfully. Known values: SUCCESS |
data[].details | object | Optional | Represents additional metadata returned for the send operation, including the message identifier. Additional keys: not allowed |
data[].details.message_id | string | Optional | Represents the unique message identifier assigned to the sent email. Maximum length: 255 |
data[].message | string | Optional | Represents the status message for the send operation. Maximum length: 500 |
data[].status | string | Optional | Represents the status of the email send operation. Possible values: **success** - The email was sent successfully. Known values: success |
Send an email to a record — request body — body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents the top-level request body for the Send Mail API, containing the email configuration objects. Additional keys: not allowed |
data | array | Required within parent | Contains the list of email configuration objects to send. Maximum items: 1 |
data[] | object | Each item | Represents the email configuration for a single send-mail request. Additional keys: not allowed |
data[].attachments | array | Optional | Represents the list of files to attach to the email, referenced by their Zoho File System (ZFS) IDs. Maximum items: 10 |
data[].attachments[] | object | Each item | Represents a file attachment referenced by its Zoho File System (ZFS) ID. Additional keys: not allowed |
data[].attachments[].id | string | Optional | Represents the unique identifier of the file in the Zoho File System (ZFS). Maximum length: 255 |
data[].bcc | array | Optional | Represents the list of BCC (blind carbon copy) recipients for the email. Maximum items: 50 |
data[].bcc[] | Model | Each item | Expand Send an email to a record — request body — body data item from |
data[].cc | array | Optional | Represents the list of CC (carbon copy) recipients for the email. Maximum items: 50 |
data[].cc[] | Model | Each item | Expand Send an email to a record — request body — body data item from |
data[].consent_email | boolean | Optional | Indicates whether the email is a GDPR consent email. Possible values: **true** - The email is a GDPR consent request. **false** - The email is not a GDPR consent request. |
data[].content | string | Optional | Represents the body content of the email. Maximum length: 100000 |
data[].data_subject_request | object | Optional | Represents the GDPR data subject request associated with the email. Additional keys: not allowed |
data[].data_subject_request.id | string | Optional | Represents the unique identifier of the GDPR data subject request. Maximum length: 100 |
data[].data_subject_request.type | string | Optional | Represents the type of GDPR data subject request. Possible values: **access** - A data access request. **rectify** - A data rectification request. **export** - A data export request. One of: access, rectify, export |
data[].from | Model | Required within parent | Expand Send an email to a record — request body — body data item from |
data[].inventory_details | object | Optional | Represents the inventory template details to attach to the email. Additional keys: not allowed |
data[].inventory_details.inventory_template | object | Optional | Represents the inventory template to attach to the email. Refer to the [Get Inventory Templates](inventory_templates.yaml#$.paths./settings/inventory_templates.get) resource for valid values. Additional keys: not allowed |
data[].inventory_details.inventory_template.id | string | Optional | Represents the unique identifier of the inventory template. Refer to the [Get Inventory Templates](inventory_templates.yaml#$.paths./settings/inventory_templates.get) resource for valid values. Maximum length: 100 |
data[].inventory_details.inventory_template.name | string | Optional | Represents the name of the inventory template. Maximum length: 100 |
data[].inventory_details.paper_type | string | Optional | Represents the paper size for the inventory template attachment. Possible values: **default** - Uses the default paper size. **A4** - A4 paper size. **us_letter** - US Letter paper size. One of: default, A4, us_letter |
data[].inventory_details.view_type | string | Optional | Represents the page orientation for the inventory template attachment. Possible values: **portrait** - Portrait orientation. **landscape** - Landscape orientation. One of: portrait, landscape |
data[].mail_format | string | Optional | Represents the format of the email body. Possible values: **html** - HTML-formatted email. **text** - Plain text email. One of: html, text |
data[].org_email | boolean | Optional | Indicates whether to send the email using the organization email address instead of the sender individual email address. Possible values: **true** - Sends the email using the organization email address. **false** - Sends the email using the sender individual email address. |
data[].reply_to | Model | Optional | Expand Send an email to a record — request body — body data item from |
data[].scheduled_time | string | Optional | Represents the scheduled date and time to send the email, in ISO 8601 date-time format. Format: date-time |
data[].subject | string | Optional | Represents the subject line of the email. Maximum length: 1000 |
data[].template | object | Optional | Represents the Email Template to use for the email. Refer to the [Get Email Templates](email_templates.yaml#$.paths./settings/email_templates.get) resource for valid values. Additional keys: not allowed |
data[].template.id | string | Optional | Represents the unique identifier of the Email Template. Refer to the [Get Email Templates](email_templates.yaml#$.paths./settings/email_templates.get) resource for valid values. Maximum length: 100 |
data[].to | array | Required within parent | Represents the list of primary recipients of the email. Maximum items: 50 |
data[].to[] | Model | Each item | Expand Send an email to a record — request body — body data item from |
Referenced models: Send an email to a record — request body — body data item from
Send an email to a record — request body — body data item from
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents an email user with an email address and an optional display name. Additional keys: not allowed |
email | string | Required within parent | Represents the email address of the user. Maximum length: 255 |
user_name | string | Optional | Represents the display name of the user. Maximum length: 255 |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: zoho.sendmail. Catalog operation: sendMail. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.