Move to folder in Zoho Mail
Table of ContentsUp
Overview
The zoho.mail.moveToFolder task is used to move an email from one folder to another in Zoho Mail. This task is based on a Zoho Mail API.
Syntax
<response> = zoho.mail.moveToFolder(<message_id>, <folder_id>/<folder_path>, <connection>);
where:
Params | Data type | Description |
<response> | KEY-VALUE | The status of the executed task. |
<message_id> | NUMBER | The ID of the email that will be moved to the specified folder. Note: You can get the message_id from the Zoho Mail URL. The URL is in the following format: |
<folder_id>/ <folder_path> | NUMBER/ TEXT | The ID or path of the folder into which the email will be moved. Note:
|
<connection> | TEXT | The link name of the Zoho Mail connection Note:
|
Example 1
The following script moves an email to the folder of ID - 6729326000000008021 in Zoho Mail:
response = zoho.mail.moveToFolder(6729326000001837113, 6729326000000008021, "mail_oauth_connection");
where:
response
6729326000001837113
6729326000000008021
"mail_oauth_connection"
Example 2
The following script moves an email to the folder with path - /inbox/folder1 in Zoho Mail:
response = zoho.mail.moveToFolder(6729326000001837113, "/inbox/folder1", "mail_oauth_connection");
where:
"/inbox/folder1"
"mail_oauth_connection"
Response Format
Success Response
- The success response will be returned in the following format:{
"message":"Action moveMessage is successful",
"status":"success"
}
Failure Response
- The failure response will be returned in the following format:{
"message":"Error while processing the request! Folder does not exist",
"status":"failure"
}