Skip to content
Knowledge ERP Docs

API Reference ↗
Integrations

Email Sync (Gmail & Outlook)

Connect Gmail or Outlook so customer correspondence is pulled into the CRM activity timeline automatically.

The email integration brings your customer correspondence into Knowledge ERP, so the CRM timeline reflects what was actually said — not just what someone remembered to log.

Connecting #

Connect Gmail or Outlook through its OAuth flow. Once authorized, Knowledge ERP stores the connection and can read the relevant mail on your behalf.

What it does #

A background sync pulls messages in and matches them to customers, folding sent and received email into the same activity timeline as notes, tasks, and other activity. The result is one chronological view of the relationship.

How a sync goes #

The sync runs about every fifteen minutes. A message is kept when it is to or from a customer or a customer contact whose email address is on file; other mail is not recorded. For mail you received, that is its sender. For mail you sent, the sync looks at the people it was sent to and then those it was copied to, and files it against the first who is a customer or contact.

Gmail. The first sync reads the Inbox and Sent folders, in steps of a few hundred messages, and carries on by itself until it has read both, so on a large mailbox older mail can take a while to appear. Mail you had already filed away or archived is not read by that first pass; from then on, mail that arrives is picked up whatever folder it lands in. Drafts, spam, trash and chats are left out, including sent mail that has since been trashed. Mail that arrives while the first pass is still going is picked up by the sync that follows. A message that was deleted while the sync was reading is skipped without holding up the rest, and one with a date we cannot read is logged with the time it was read; if Google itself refuses or fails, the sync stops and tries again later rather than skipping the message.

Outlook. The Inbox and Sent Items folders are read, each keeping its own place, in steps of a few dozen messages that carry on by themselves; after the first pass Microsoft is asked only for what has changed since. Mail in any other folder, an Archive folder for instance, is not read. A message with a date we cannot read is filed under the time it was read, and a message missing its body or an address does not hold up the ones after it.

When part of a mailbox cannot be read #

Each folder is read on its own. If Google or Microsoft fails on one folder (the Inbox, say), the other is still read in the same sync, and mail read before the failure is kept. Email Connections then shows, under the mailbox, which folder could not be read and, when the provider answered, the status code it gave, for example "Sent Items could not be read (Microsoft returned 503)". If the provider did not answer at all it says so, and if the problem was on our side it says only that the folder could not be read. The sync tries it again about fifteen minutes later. The note goes away once a sync reads everything. If no folder can be read at all, for instance because the connection was revoked, the sync fails and tries again later, as before.

For Gmail this applies to the first read, which covers the Inbox and Sent folders. After it, changes arrive from Google as one list, so there is no folder to set aside.

Setup note #

Gmail and Outlook each require OAuth client credentials configured in their respective developer consoles (Google Cloud, Azure AD), with redirect URIs pointed back at Knowledge ERP. See your administrator for the go-live setup.