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:

  1. System slash commands - The commands that are available by default that can be used to invoke Zoho applications
  2. 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:

  1. Log in to Zoho Mail.
  2. Navigate to Settings > Integrations > Developer Space > Slash Commands.
  3. Click Create Command.
  4. 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.
  5. 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.
  6. Upload an image for the slash command you create. A Slash (/) will be applied by default if no image is uploaded.
  7. Click Save.
  8. You will be taken to the created slash command page. You need to Authenticate the connector configured in order to successfully invoke the command.
  9. 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:

  1. Navigate to the command created.
  2. Click Add operation.
  3. Provide a Name and Description for the operation. The name should not have any capital letters/ special characters/ space.
  4. 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.
    1. The Text field can be used to get values from the user to post or fetch any data using the API.
    2. The List field can be used to list values to choose. The List can be:
      1. Fixed (i.e. based on predefined values available in an application) 
      2. Variable (i.e., the list values can be fetched and shown dynamically from an application using an API)
  5. Provide the API URLHTTP method, Parameters, and Headers of the API.
  6. Click Save.
  7. 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. 
    1. To create a custom function, click on Write Function button in the Custom Function section of the Edit Operation screen.
    2. Choose an existing Slash Command custom function or Click Create Function.
    3. You can choose to use the predefined templates to display the data fetched. The predefined templates available are:
      1. Text
      2. Card
      3. Table
      4. Button
      5. Image
      6. List
    4. Once you create the custom function, you can save it and choose the function while creating an operation in Slash command. 
  8. 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.

System Commands

Still can't find what you're looking for?

Write to us: support@zohomail.com