🆕Gmail
Lean how to integrate Gmail to your chatbot with an Action block.
Last updated
Lean how to integrate Gmail to your chatbot with an Action block.
Last updated
This guide explains how to enhance your chatbot by integrating Gmail for sending emails, making it a versatile tool for communication and automation.
The Gmail feature shouldn't be confused with the Send mail Action step, which allows you to send emails that are Chatlayer-branded. With the Gmail integration, you can send emails directly from your own Gmail account.
Within your chatbot's workflow, locate and add a new Action block.
Choose Integrations from the options available and then select the Gmail app.
You will be presented with an Action field. Select Send Email to proceed.
In the Gmail account section, click on Connect new account to connect your account.
Follow the on-screen instructions to authorize your chatbot to access the Gmail account. This process may require you to log in to your Gmail account and grant specific permissions.
In the Action fields, locate the To input field to specify the recipient(s) of the email. There are 2 possibilities:
If your bot has already collected the user's email address and saved it in a variable (e.g., {userEmailAddress}
), you can use this variable directly.
Alternatively, you can manually type the email addresses of the recipients, separating multiple addresses with commas.
In the Subject field, personalize the email subject based on the interaction context. For instance, if you're sending a gym class booking confirmation, use the variable {className}
to dynamically insert the class name. An example subject could be 🧘♂️Your {className}
Class Booking Confirmation.
Compose the body of your email in the Email content field. Use variables to personalize the email content with information collected by the bot, such as booking details for a gym class.
Specify a destination variable name where the response from Gmail will be stored. This is useful for tracking the success or failure of the email sending operation.
Optionally, select a block to handle situations where the operation fails, allowing for graceful error handling within your chatbot flow. For instance, in this example, we used the Error occurred block.
After completing the setup and configuration, ensure to click Save to apply your changes.
By following these detailed steps, you can empower your chatbot with the ability to send emails via Gmail, enhancing its utility and your users' experience.