The farmerswife server application "Google Invites" feature by default uses a farmerswife-own google account to access the google calendar API and send the invites. Due to this, occasionally users will encounter an error for "Domain usage limits exceeded" and their invites will not be sent. This is caused by the farmerswife service account maxing out its invites for the time frame since it is used across all farmerswife clients.
Starting in farmerswife version 6.7 you may optionally configure the Google Invites Connector to use your own google business domain which offers 2 primary benefits. This feature does require the use of a professional google account in order to configure the following steps, and it requires a "Super Admin" Google Permission level, in order to get access to the following areas within the Google environment.
1. Invites will now show as being from your own organization instead of a generic domain.
2. Limits on the number of invites will most likely no longer be an issue since invites on the same domain (a.k.a. internal to your organization) no longer count against the limit and only invites sent from your own server will be counted against the cap, instead of across all farmerswife clients.
NOTE: This article is intended only for configuring the connector to use your own domain for generating invites, information on setting up the "default" Google Invites integration can be found here.
IMPORTANT: Before you get started, ensure your Google user has a "Super Admin" Google Permission level!
Section 1 - Configuring the Google Workspace
You need to generate 5 values to be placed inside of the farmerswife connector:
Calendar ID: Id of a calendar created within your workspace
Service ID: ID of service account associated with a project in your Google Workspace
User Email: User who created the calendar whose Calendar ID gets used in the above
RSA Private Key Password: Provided by Google when creating an RSA key
RSA Private Key: Provided by Google, then converted for use by your farmerswife system
1.1 - Creating Google Service ID
NOTE: This "Service ID" is labeled as the "Client ID" within your Google Workspace.
Go to https://console.cloud.google.com/
Create a Service Account (https://developers.google.com/identity/protocols/oauth2/service-account):
Then in the Account DETAILS, make a note of the "Unique ID" of this Service Account:
1.2 Delegating domain-wide authority to the service account
As per the above screenshot on the "SHOW DOMAIN-WIDE DELEGATION" section at the bottom, use the option "SHOW ADVANCED SETTINGS" ... which can also be called "VIEW GOOGLE WORKSPACE ADMIN CONSOLE"
Or, you simply log in to the Google Admin Panel using this link https://admin.google.com/) and go to Security > API Controls:
Expand the "API controls" section and click on "MANAGE DOMAIN WIDE DELEGATION" - IMPORTANT: "Domain-wide delegation" is only available with "Super Admin" Google Admin level permissions:
Then on the "Domain-wide Delegation" page in the "API clients" section click on the "Add new" option to get to the "Add a new client ID" window:
Add in your Service Accounts Unique ID - here called "Client ID", and this info came from the previous above step where you made "a note of the "Unique ID" of this Service Account".
Add the following "OAuth Scope" parameters :
OAuth scopes:
https://www.googleapis.com/auth/calendar
https://www.googleapis.com/auth/drive
Once this is complete, you need to go back to the Google cloud console (https://console.cloud.google.com/).
In your IAM & Admin > Service Accounts (back in here: https://console.cloud.google.com/ ), select Show-Domain-Wide-Delegation and check the box for "Enable Google Workspace Domain-Wide Delegation":
Permissions: Enable "Google Calendar API" at the URL https://console.developers.google.com/apis/api/calendar-json.googleapis.com/overview?project={your_project_ID}.. The easiest way to get this link is actually to skip this step, then when attempting to use the feature, the resulting error text will contain the link with your Project ID built-in, you can also build the link by adding your Project ID onto the end.
1.3 - Creating an RSA Key
On your Manage Service Accounts Dashboard, use the three-dot menu on the right-hand side of your new Service account and use Manage keys:
Create a new Key being sure to select P12 and make a note of the RSA Key Password provided by Google since it will be not provided again:
... and then:
With this key, you then need to modify it to get a readable file so the contents can be put into the farmerswife-side settings.
You do this with the following command changing "your-downloaded-key.p12" to be the name of our downloaded file. google-invites-pcks1.key may also be modified to create a different file name. Note the password prompted is the RSA Key Password copied during the Key creation above.
openssl pkcs12 -in "your-downloaded-key.p12" -nodes -nocerts | openssl rsa -out google-invites-pcks1.key
Once this is complete you will have a readable google-invites-pcks1.key file with your RSA Key Values:
1.3 - Creating a Calendar
Using an account in your Google Workspace create a new calendar and copy the calendar ID, this is where farmerswife will create all events and then invite people to.
NOTE: A best practice would be, to use an account not associated with a farmerswife user, since invites sent to them do not generate an invite, they simply appear on the calendar since the user is the owner.
Once created, the Calendar ID is available at the bottom of the Calendars settings under Integrations:
Section 2 - Configuring farmerswife
Within the farmerswife Client desktop app, go to: Toolbox > Settings > Server Setup.
Then at the bottom use, the Setup button under the Google Invites section. Paste in all the values from above into the appropriate fields and hit OK to save and exit.
Now when booking a user with Google Invites enabled in their Web Permission Profile => "Send Google Calendar Invites" setting enabled, this information gets used to create the invite:
As a note, all events will be visible on the Calendar whose ID you used for creation: