Slash Commands
Slash commands send HTTP requests that are made by typing a message that starts with a (/). Using slash commands you can invoke any application using an API to fetch information and perform actions based on the commands.
In Zoho Mail, you can create and use slash commands to invoke any application from the Mail Assistant. You can also use the Slash commands in your compose window to fetch and add data from any other application to the composer. All that you need to do is to have a Slash command configured and installed. To invoke the command from Composer, type / in the compose window. Mail Assistant will be opened to help you complete the command based on your need.
Enable Slash Commands
Slash commands will be disabled for the users in the organization by default. The administrators need to enable it for the users to start creating and using the commands. Learn more
There are two sets of commands that are available:
- System slash commands - The commands that are available by default that can be used to invoke Zoho applications
- Custom slash commands - The commands that can be created by users in the organization. These commands can also be shared with other users in the organization after approval by the administrators.
Create a Slash Command
You can create slash commands in Zoho Mail to invoke any application (both Zoho and non-Zoho apps) using an API.
To create a new Slash command:
- Log in to Zoho Mail.
- Navigate to Settings > Integrations > Developer Space > Slash Commands.
- Click Create Command.
- Provide a Name and Description for the command you want to create. The name you provide will be the command message that you use to invoke an application.
- For example, if you provide the name mail, then the slash command will be /mail.
- Choose the Service Name for which you want to invoke the command. The service name will list down the Connectors configured in Zoho Mail to communicate with other applications.
- Upload an image for the slash command you create. A Slash (/) will be applied by default if no image is uploaded.
- Click Save.
- You will be taken to the created slash command page. You need to Authenticate the connector configured in order to successfully invoke the command.
- Click Accept in the authentication screen.
Once authenticated, you need to add operation(s) that will fetch/ update the input parameters of the API using which the command needs to be executed.
Note:
If you are fetching data from an application that requires app authentication, you need to have a connector configured to invoke a slash command. Refer here, to create a Connector in Zoho Mail.
Add an Operation
The operation is configured using an API and its input parameters that are required to invoke an application. You can configure different operations to be performed by an application.
For example, you can add operations to compose, fetch, and delete emails in the /mail slash command.
To add an operation:
- Navigate to the command created.
- Click Add operation.
- Provide a Name and Description for the operation. The name should not have any capital letters/ special characters/ space.
- Use the Arguments to get the inputs from the user using the Text and List fields. The input parameters in the API can be collected from the users through the Arguments.
- The Text field can be used to get values from the user to post or fetch any data using the API.
- The List field can be used to list values to choose. The List can be:
- Fixed (i.e. based on predefined values available in an application)
- Variable (i.e., the list values can be fetched and shown dynamically from an application using an API)
- Provide the API URL, HTTP method, Parameters, and Headers of the API.
- Click Save.
- Once saved, you can also choose to create a custom function to display the data fetched using a Slash Command operation in a preferred format.
- To create a custom function, click on Write Function button in the Custom Function section of the Edit Operation screen.
- Choose an existing Slash Command custom function or Click Create Function.
- You can choose to use the predefined templates to display the data fetched. The predefined templates available are:
- Text
- Card
- Table
- Button
- Image
- List
- Once you create the custom function, you can save it and choose the function while creating an operation in Slash command.
- Click Save.
The operation will be saved and the slash command will be installed. You can use it to invoke an application from the Mail Assistant.
Note:
If the operation that you create has dependent operations using which data is fetched, you should create the dependent operations first.
For example, in the /zmail slash command available in the System Commands section, an operation to /getNotes is provided. The /getNotes operation depends on the /getGroups operation to fetch and list the groups that the user is part of. Hence, the /getGroups operation should be created first to have it invoked in the /getNotes operation.
Installed Commands
To use the slash commands from Mail Assistant or your compose window, you need to have the commands installed. These commands will be listed under the Installed commands section.
My Commands
The slash commands you create will be listed under the My Commands section. You can click on the command to view the operations created under the command, and edit, delete, or share the command within your organization.
Org Commands
The organization commands will list the slash commands that are shared by users within the organization. You can choose to Install the commands to use them from your mailbox.
Share with org
The users in an organization can create slash commands and share them within the organization. The administrator of the organization should approve the commands from the Admin Console. Once approved, those commands will be available under the Org commands section. Users can Install/ Uninstall the commands based on their requirements.
System Commands
The default commands will be available for all users and can be used to invoke the Zoho Applications from the Zoho Mail interface. You can choose to Enable/ Disable them based on your preference.