Open in HubvThe Gmail integration allows your bot to chat with users via your Gmail address.
Once you’ve successfully configured the Gmail integration, the email address you provided will begin responding to all incoming emails as your bot. Please be aware of this behaviour before configuring the integration.
Due to the sensitive nature of email communication, the Gmail integration requires a secure connection between Botpress and Gmail. To establish this secure connection, you need to configure the Gmail integration using OAuth.
Automatic configuration is temporarily unavailable
The Gmail integration is currently undergoing a verification process by Google. This means the option to automatically configure your Gmail integration is temporarily unavailable.You can still set up the integration using manual configuration.
In Google Cloud Console, search for and navigate to the Pub/Sub section.
Select Subscriptions in the left sidebar.
Select Create subscription.
Enter a name for the subscription in the Subscription ID field.
Select the topic you created earlier from the topic dropdown.
Under Delivery type, select Push.
Enter your integration’s Botpress-provided webhook URL in the Endpoint URL field. To this URL, add ?shared_secret=, followed by the shared secret you generated earlier.
For example, if:
Your integration’s webhook URL is: https://webhook.botpress.cloud/57fcfb04-51fd-4381-909a-10e6ae53d310
Your shared secret is Ut5hzrxs7uV87mzCAKL3ztrzesWWBiNa
You would enter:https://webhook.botpress.cloud/57fcfb04-51fd-4381-909a-10e6ae53d310?shared_secret=Ut5hzrxs7uV87mzCAKL3ztrzesWWBiNain the Endpoint URL field.
Check the Enable authentication checkbox.
Select the service account email address you created earlier in the Service account field.
Enter the shared secret you generated earlier in the Audience field.
Under Expiration period, select Never expire.
Under Acknowledgement deadline, enter 60 seconds.
Under Retry policy, select Retry after exponential backoff delay. Set the minimum backoff to 60 seconds and the maximum backoff to 600 seconds.
Make sure to add your OAuth Client ID from Step 4 to the end of the URL. For example, if your OAuth client ID is abcd, the URL should end with &client_id=abcd.
Follow the on-screen instructions to authorize the OAuth application with your personal Gmail account.
After completing the authorization, you will be redirected to botpress.com. Don’t close this page.
Copy the authorization code from the URL in your browser’s address bar. The authorization code is the string that appears after code= and before &scope= in the URL.
Botpress shall not be held responsible for any costs you may incur on the Google Cloud Platform while using the Gmail integration, should you choose to use the manual configuration mode. Ensure that you are aware of the costs associated with using the Gmail API and the Google Cloud Platform before using the manual configuration mode.
API limits
Standard Gmail API limitations apply to the Gmail integration in Botpress. These limitations include rate limits, message size restrictions, and other constraints imposed by the Gmail and Google Cloud platforms. Ensure that your bot adheres to these limitations to maintain optimal performance and reliability.More details are available in the Gmail API documentation.