Prerequisites
- A Google Cloud project with billing enabled
- Gmail API and Cloud Pub/Sub API enabled
- A Google OAuth 2.0 application for workspace integration
- A publicly reachable URL for this apowerb instance
Setup
1
Enable the APIs
2
Create the topic
3
Let Gmail publish to it
In the Cloud Console the “Publisher” role may not appear in the dropdown. Type
“publisher” in the search box, or use the command above.
4
Create the push subscription
5
Configure OAuth 2.0
In Google Cloud Console → Credentials, create an OAuth 2.0 Client ID of type
Web application, add the redirect URI
https://YOUR_DOMAIN/integrations/google/callback, and the scope
https://www.googleapis.com/auth/gmail.readonly.6
Set the environment
7
Connect the account and subscribe
Connect Google (Gmail) from the interface, then create the subscription: