twenty
twenty copied to clipboard
Webhook Sync on gmail 📨
Discussed in https://github.com/twentyhq/twenty/discussions/3937
Originally posted by FelixMalfait February 13, 2024 As of today the email sync is done through a cron that runs every 10 minutes. We'll need to provide immediate sync through webhooks.
We'll start with gmail.
- Create an environment variables to store the topic. Document it in
enviroment-variables.mdx
. Default value = gmail - Call the /watch endpoint to subscribe to account upon mailbox connection
- Create an endpoint to receive subscriptions events and import email (ref)
- Create the topic and push subscription in our Google Cloud Console
- Setup a cron to renew the /watch API call, configure it to run daily