Skip to main content

OAuth for Microsoft Outlook 365 and Google Gmail - Knowledgebase / SalesPad / Setup - Cavallo Technical Support

OAuth for Microsoft Outlook 365 and Google Gmail

Authors list

Overview

SalesPad versions 5.2.33 and above can use OAuth when sending email via Microsoft Outlook 365 or Google Gmail. OAuth provides more security than basic authentication and receives much better support from Microsoft and Google.

Setup

There are two ways to configure SMTP (Simple Mail Transfer Protocol) accounts within SalesPad: the Sales Email Confirmation settings and the SMTP Setup module. Each method has pros and cons:

  • Sales Email Confirmation only supports one SMTP account, while SMTP Setup supports multiple SMTP accounts. However, if configured correctly, a single SMTP account can unlock access to other email accounts within the same domain depending on the email server configuration.
  • As of version 5.2.33, every piece of emailing functionality in SalesPad has the capability of using the Sales Email Confirmation account, while only a subset of emailing functionality supports using the current user’s SMTP Setup account.
  • Sales Email Confirmation is easier to set up and maintain since its SMTP account is shared among all users, while SMTP Setup accounts are usually tied to a single system user.

Note: SalesPad’s Google OAuth functionality uses Gmail API instead of contacting Google’s SMTP server directly, but for the sake of simplicity the mentioned setup modules and this documentation will incorrectly imply that Gmail API is a form of SMTP.

Sales Email Confirmation

The Sales Email Confirmation account can be set up within the Settings module. Search for ‘Sales Email Confirmation’ to show the relevant settings.7r6oZKKHRVIXLUTS7RF6N3HYejJI5x56.png?access_token=snclev-hhkkmsnjpb-0f99bcc06afa332ec1ddc04b8feca5b02f1eb88c

Fill out the SMTP User setting. You may either manually type in a user, or use the setting’s ellipses button to sign in to Microsoft or Google and use the email address you select during that process. If you sign in, SalesPad will save the resulting access token to the database, so you and other users will not have to sign in again later.WVH90oIdJeAPIAXM0k5aHSDouoAn9qgd.png?access_token=snclew-evpdmblbuh-fb4f2f8dba43e8cc623ffd167230868e47c9a340

Next, fill out the remaining settings. The following table provides the typical values for Outlook 365 and Gmail. Alternate values may work for Outlook 365, whereas Gmail is locked down to the following configuration:

Setting
Outlook 365
Gmail
Email Server hostname
smtp.office365.com
gmail.googleapis.com
SMTP OAuth Service Provider
Microsoft
Google
SMTP Port
587
443
Enable SMTP over SSL or TLS
True
(ignored)
SSL or TLS Startup Method
Auto
(ignored)
SMTP Timeout
100000
(ignored)

‘Email To Fax Format String’ also appears in the Sales Email Confirmation category, but is not directly related to SMTP configuration.

SMTP Setup

SMTP Setup accounts can be configured within the SMTP Setup module. Open that module to view the current list of SMTP accounts.n5iiC3nLMO2WNy0lFNXgUSLWhocLgisv.png?access_token=snclet-kekiszamwu-e720963fd7c6583687a00764e66b5e105c88b088

Users can add and edit SMTP accounts from this module by clicking the respective buttons in the header. Both buttons will open this screen:p5clyxNHuX1ixBGJt62xuyTAHrKdtlU2.png?access_token=sncleq-wqpbtyfibj-8dff71eebf6b7dfb098772a72323ac96dc0d8be1

The quickest way to add a new OAuth configuration is to click the ‘Sign In’ button. After clicking that button, click ‘Sign in with Google' or ‘Sign in with Microsoft’ to sign in with the selected service provider.JxuzfGxCBEdzOurgtJ3rW5HKuCJmOsYg.png?access_token=snclet-pwdwvegnkd-040e149ef9f61022af81d51c18f5535f92afa8be

After signing in, SalesPad populates most of the fields with information from the sign-in process. If using Microsoft OAuth, the Hostname, Port, and SSL fields can be changed from their recommended defaults as needed. SalesPad also saves the access token from the sign-in process to the database, so you and other users will not have to sign in again later.Nj9pCNwuNIv4Yo77SwqWWhvlri3wxpPO.png?access_token=sncleu-ruejnywbfb-4b6e2c343e11e95edfa0e0b4b9f3ba0ef00be29e

Finally, fill out the Business Object, Column Name, and Column Value fields as appropriate. Most email functionality that uses SMTP Setup accounts will look for an SMTP Setup with ‘Business Object’ set to ‘SystemUser’, ‘Column Name’ set to ‘User_Name’, and ‘Column Value’ set to the currently signed-in system user. For example, if a system user called ‘sa’ sends an email from Sales Document Entry, SalesPad would use the following SMTP Setup if it existed:UsCvsNBzoAtOPwiDO4HQsa5PiqHRCPnA.png?access_token=snclex-fmbwheiutf-17bb6826cf8adeb518b7ff675df7ee6346fc6add

When finished creating or editing the SMTP Setup, click the ‘OK’ button to save it.

Usage

Once configured, sending email via OAuth works very similarly to sending email via basic authentication. If SalesPad already has an access token, nothing will be different about sending email from Sales Document Entry, sending email via smart printing, sending email via Automation Agent, and so on. If you signed in to Microsoft or Google as part of configuring an SMTP account, SalesPad will already have an access token.

If SalesPad does not have an access token or something revoked the token, the next time a user tries to send an email with that SMTP configuration, SalesPad will ask the user to sign in to Microsoft or Google. The user must sign in with the SMTP account which was previously entered into the ‘SMTP User’ setting or SMTP Setup field. The sign-in will default to that account, but if the user selects a different account the email may fail to send with an error and SalesPad will ask that user to sign in again next time.U8bvaTbjqFfWbisYpYtN3tiCertNnfRx.png?access_token=snclez-cwmeknqles-e94401e3749bc2e4ef877fddc598c14028cc80ee

If the setting ‘Can Sign In When Sending Email’ is set to ‘False’, users will get an error message when trying to send an email without an access token instead of a sign-in screen. In this situation, users must go to the screen where their SMTP configuration is to sign in. For Sales Email Confirmation, the sign-in button is the ellipses button on the ‘SMTP User’ setting. For SMTP Setup, edit the SMTP Setup you want to sign in to and click the ‘Sign In’ button.

Likewise, the Automation Agent Service cannot ask a user to sign in when necessary regardless of that setting’s value. If Automation Agent gives errors such as “Failed to obtain an access token”, an administrator must sign in to Microsoft or Google via Sales Email Confirmation settings or SMTP Setup. Once signed in, Automation Agent can send emails via OAuth seamlessly.

Helpful Unhelpful