Sending Mail through Gmail¶
Hire2Retire now supports sending mails through your Gmail account using OAuth based and certificate based authentication mechanism.
Service Provider Application¶
Google application on Hire2Retire uses OAuth authorization. By linking your Google account with Hire2Retire, you can authorise the RoboMQ application to have delegated access to send mail on your behalf, for which you will be provided with a consent window to provide permission required by Hire2Retire. RoboMQ needs the following permissions on your account to provide a seamless integration experience
Scopes | Explanation |
---|---|
auth/userinfo.email | See your primary Google Account email address |
auth/userinfo.profile | See your personal info, including any personal info you've made publicly available |
auth/gmail.send | Send email on your behalf. |
Create a Connection¶
You need to have an Google account with mailbox enabled before using Gmail services on Hire2Retire.
-
To authenticate your account you need to click the
Link account
button, which will redirect you to the Google sign-in page. -
Here, you can select an existing account or add a new google account.
-
Following successful signup or account selection, Google presents you with a permissions page. On this page, you will be asked to provide certain permissions that are required by Hire2Retire to send mails on your behalf.
-
Once you've consented to the permissions, you will be redirected back to Hire2Retire. This redirection signifies the successful establishment of the connection between the two platforms.
Customer Owned Application¶
Hire2Retire does not require the user to sign-in for this connection. Instead, for automation purposes, it will use your application service account to impersonate an user account. Choosing this connection requires you to manage your service account's Application Permission in your Google instance.
Create a Connection¶
-
Firstly create a project in google cloud platform.
-
Enable Gmail API for that project, by following the below mentioned steps:
- Go to API’s and services from the side menu bar then select Enabled API’s and services
- Click enable API’s and services from the top menu bar.
- Search Gmail and enable the Gmail API for the project.
-
Create Service Account for that project
- Go to Service Account section by selecting the IAM & admin from the side menu bar and selectng the service account.
- Click on Create new Service Account from the top menu bar and fill the account name field and click
Create and Continue
-
Go to Google Admin Console to give your service account domain wide delegation by following the instructions below
- Select
API controls
by going toSecurity
>Access and data Control
from the side menu bar.
- Click
Add New
and enter the client ID and addhttps://www.googleapis.com/auth/gmail.send
as the scope.
- Select
-
Download the certificate from the Hire2Retire connection UI and add that certificate to the service account created in the google console by following the below steps;
- Select the service account and go to the keys section from the top navigation menu
- Select Upload existing key, browse the certificate which you downloaded from the Hire2Retire connection UI and upload it.
-
Enter the service account and the user account of your organization through which you want the mails to be sent and link the account.