EmailDrafts
Query, create, update or delete email drafts associated with a record in Zoho CRM account.
Table-Specific Information
Select
'ModuleApiName' and 'RecordId' are required as filters when querying this table. The add-in uses the Zoho CRM API to process WHERE clause conditions built with the following columns and operators.
- ModuleApiName, RecordId and Id support the '=' operator.
For example, the following queries are processed server side:
SELECT * FROM EmailDrafts WHERE ModuleApiName = 'Invoices' AND RecordId = '1170218000000675001'; SELECT * FROM EmailDrafts WHERE ModuleApiName = 'Leads' AND RecordId = '1170218000000570264' AND Id = 'f98d838f42c48a29b53fb632d556b8d633f5c98df2e38ba0c96273cf16df7c04';
Insert
"From" and "RichText" are required columns for insertion.
INSERT INTO EmailDrafts (ModuleApiName, RecordId, "From", RichText, To, ReplyTo, Subject, Content, ScheduleDetailsTime, Cc, Bcc, Attachments, InventoryDetailsViewType, InventoryDetailsPaperType, InventoryDetailsInventoryTemplateId) VALUES ('Leads', '1170218000000570264', '[email protected]', false, '[{"email": "[email protected]"}]', '[email protected]', 'text subject', 'text content', '2001-01-01T01:01:01Z', '[{"email":"[email protected]"},{"email":"[email protected]"}]', '[{"email":"[email protected]"},{"email":"[email protected]"}]', '[{"id": "244561abc60c0cd6bddd10337af57c9830f0d2f5b8ee44743722e20a196ee830c7f1a9a4390f9bb78b511295a45fa45b", "file_name": "test.png"}]', 'portrait', 'A4', '1');
Update
Specify the ModuleApiName, RecordId and Id in the WHERE clause when executing an update in this table.
UPDATE EmailDrafts SET To = '[{"email": "[email protected]"}]', "From" = '[email protected]', RichText = false, ReplyTo = '[email protected]', Cc = '[{"email": "[email protected]"}]', Bcc = '[{"email": "[email protected]"}]', Subject = 'text subject', Content = 'text content', ScheduleDetailsTime = '2001-01-001T12:12:12Z' WHERE Id = 'f98d838f42c48a29b53fb632d556b8d61b496756fe3ba2174d31cd8508b0c14a' AND ModuleApiName = 'Leads' AND RecordId = '1170218000000570264';
Delete
Specify the ModuleApiName, RecordId and Id in the WHERE clause when executing a delete in this table.
DELETE FROM EmailDrafts where Id = 'f98d838f42c48a29b53fb632d556b8d64a4697697e14d4dfea69fbae84026919' AND RecordId = '1170218000000570264' AND ModuleApiName = 'Leads';
Columns
| Name | Type | ReadOnly | Description |
| Id [KEY] | String | True |
The unique ID of the email draft. |
| ModuleApiName [KEY] | String | False |
The API name of the module where the record for which you want email drafts exists in. |
| RecordId [KEY] | String | False |
The Id of the record you want email drafts of. |
| To | String | False |
The user name and email address to which the email is drafted to be sent. |
| From | String | False |
The from address for the email draft. |
| InventoryDetailsViewType | String | False |
The way you want to view the template in. The allowed values are portrait, landscape. |
| InventoryDetailsInventoryTemplateName | String | True |
The unique ID of the inventory template you want to use in your email. |
| InventoryDetailsInventoryTemplateId | String | False |
The name of the inventory template you want to use in your email. |
| InventoryDetailsPaperType | String | False |
The paper type for digital printing. The allowed values are A4, default, us_letter. |
| InventoryDetailsRecordName | String | True |
The record name of the inventory details of the email draft. |
| InventoryDetailsRecordId | Long | True |
The record Id of the inventory details of the email draft. |
| RichText | Boolean | False |
Specifies whether the format of the email is rich text or not. |
| ReplyTo | String | False |
The email address that you want the user would reply to after receiving the mail. |
| ModifiedAt | Datetime | True |
The date and time at which the email draft was last modified. |
| Subject | String | False |
The subject of the email. |
| Content | String | False |
The content of the email draft. |
| Attachments | String | False |
The attachments for the email draft. |
| Cc | String | False |
The user name and email address to cc the email to. |
| Bcc | String | False |
The user name and email address to bcc the email to. |
| CreatedAt | Datetime | True |
The date and time at which the email draft was created. |
| Summary | String | True |
Displays the first 250 characters of the email content. |
| ScheduleDetailsTime | Datetime | False |
The schedule time for the email draft. |