Set Tag in Zoho Mail
Table of Contents
Note:
- This task is applicable to all Zoho services, except Zoho Creator.
- Each time the zoho.mail.setTag integration task is executed, it triggers an API request in the back-end. This call is deducted from the external calls limit available for the service from which the task is executed, based on your pricing plan.
- Only actual executions that receive a response (whether success or failure) are counted, not the number of times the task appears in the script. For example, if zoho.mail.setTag integration task is placed inside a for each task that iterates five times, the number of external calls consumed will be five, even though the task appears only once in the script.
Overview
The zoho.mail.setTag task is used to set tags to the specified email in Zoho Mail.
Syntax
<response> = zoho.mail.setTag(<message_id>, <tag>, <connection>);
where:
| Params | Data type | Description |
| <response> | KEY-VALUE | The response that represents the status of the executed task. |
| <message_id> | NUMBER | The ID of the email to which the tag will be set. |
| <tag> | NUMBER/ LIST/ TEXT | The ID or the name of the tag that will be set to the specified email. Note:
|
| <connection> | TEXT | The link name of the connection. Note:
|
Example 1: Set tag to an email using tag ID
The following example sets the tag with ID - 6729326000000548039 to the email with ID - 6729326000001836629 in Zoho Mail:
response = zoho.mail.setTag(6729326000001836629, 6729326000000548039, "mail_oauth_connection");
where:
response
6729326000001836629
6729326000000548039
"mail_oauth_connection"
Example 2: Set tag to an email using tag name
The following example sets the tag - blog to the email with ID - 6729326000001836629 in Zoho Mail:
response = zoho.mail.setTag(6729326000001836629, "blog", "mail_oauth_connection");
where:
"blog"
Example 3: Set multiple tags to an email
The following example sets the tags specified in - tag_ids to the email with ID - 6729326000001836629 in Zoho Mail:
// Create a list variable to hold the IDs of the tags that will be set to the specified email tag_ids = List(); tag_ids.add(266980000000005034); tag_ids.add(266980000000005036); tag_ids.add(266980000000014001); // Execute the set tag task response = zoho.mail.setTag(6729326000001836629, tag_ids, "mail_oauth_connection");
where:
tag_ids
Response
Success Response
The success response will be returned in the following format:
{
"message":"Action markLabels is successful",
"status":"success"
}
Failure Response
The failure response will be returned in the following format:
{
"message":"Error while processing the request! The label with label-id(s) [6729326000000008027] are not available",
"status":"failure"
}