Google Docs
To start setting up your google cloud console for production with MailLink.
Navigate to https://console.cloud.google.com/ and create a new project, call it anything you want (your company name is probably a good idea)
Then go to the sidebar and click on the 3 horizontal lines to open the side bar, and navigate to the Enabled APIs & services page by clicking on the button. Once there you need to press the “Enable APIs and services” button
You should get to a page that looks a bit like this
Once here, search for gmail in the search box and hit enter, then click the Gmail API option from the results
Then click the “Enable” button, and wait for google to do its thing for a second.
Then click the back button, and once again press the “Enable APIs and services” button
This time, search for “pubsub” and hit enter. Then select the option titled “Cloud Pub/Sub API” (not the lite version)
And enable it if it looks like the image, if there is a Manage button there instead then just skip this step.
Then go back to the Enabled APIs and services page, which can be done with the back arrow.
Then navigate to the Credentials page
Click the “Create Credentials” button and then press the “Oauth client ID” button
On the page you were redirected to, select Web Application
Leave the name as is, or change it (It is only for internal use). Then add your websites URL to the authorized javascript origins
For the authorized redirect URI's. You just need to go to your MailLink dashboard where you should have enabled gmail in your production environment, and there will be the URI you need to add, ready to copy.
So copy that and put it in the authorized redirect URI section
Once you've done this, press the Create button at the bottom of the page, a popup should appear with the client id, copy this and paste it into the client id field on the MailLink dashboard
Once you've done that and clicked OK on the popup box you should be taken to a page like this (I just created Web client 2, yours will be called whatever you named it)
Now click on your newly created Oauth 2 client (Mines called Web client 2) and you should get a screen similar to this (I've redacted some data from the image)
In the bottom right you can see the client secret, click the copy button and then paste it into your MailLink dashboard where it says Client Secret.
Now go back to the google dashboard and type “pubsub” in the search bar at the top, then click on the top result “Pub/Sub”.
On this page, click the “Create topic” button
Then name it something such as “gmail-notify” and click create
Now on the new page you've been brought to copy the topic name, and paste it into the MailLink dashboard's “Topic Name” field.
Now all you need to do is click add principal on the right of the google dashboard, then give it a principal of “gmail-api-push@system.gserviceaccount.com” and set the Role to Pub/Sub Admin, then hit Save.
Now go to your MailLink dashboard and make sure you press the “Save Changes” button. Once you've done that, gmail connections will work in your production environment.