Setting up Email Service
- Navigate to the Google Cloud Platform console and click on your project/create a new project.
-
Navigate to “APIs & Services” on the left pane and click on Credentials.
- Click “Create Credentials” with OAuth Client ID option, and fill in the form (set user type to internal)
-
Navigate back to the Credentials page and click Create Credentials again with OAuth Client ID option. Select “Web Application” and set “Authorised Redirect URIs” to https://developers.google.com/oauthplayground
-
Click Create and keep the Client ID and secret given.
-
Navigate to https://developers.google.com/oauthplayground and click settings. Check off “Use your own OAuth credentials” and fill in the Client ID and secret from Step 5.
-
In the box labelled “Input your own scopes” type https://mail.google.com/ and click Authorize APIs.
-
Click the account you want to use to send emails and grant email permissions.
-
Click “Exchange authorization code for tokens”.
-
Keep the refresh token given.
-
Navigate to the Google Cloud Platform console -> APIs & Services -> Library -> Gmail API, and click Enable.
- Add the refresh token, client ID, and client secret from above to the root .env file. Also add the address of the mailing account.
MAILER_USER=<insert-email-address> MAILER_REFRESH_TOKEN=<insert-your-token> MAILER_CLIENT_SECRET=<insert-your-secret> MAILER_CLIENT_ID=<insert-your-id>
- If you are using Python with auth, please update line 26 in
backend/python/app/rest/auth_routes.py
, as well as line 25 inbackend/python/app/rest/user_routes.py
to be your desired display name.