Just a simple work with automatic email with Google API
Status: Develooping
I'm working on README...please wait. :^)
This program send automatic emails to new applications in Google forms.
To make this work you need to make a Google spreadsheet linked to a forms that asks for the person's name and email.
First you need to configure you google account to work with external applications:
- Enable two-steps verification on your Google account
- Add an app password to your mail and select the plataform you're using (In my case is Windows) and save the generated password
- Put your email and App password in .env file
Now you need to enable Google APIs (Google Drive and Google Sheats)
- Access console.cloud.google.com (just serch for Google developer console)
- Click in APIs & Services > Enable APIs & Services.
- Then click in creat project.
- Name your project and change the location if you want.
- Click in OK.
- Now in OAuth 2.0 Client IDs click in
- In the serch bar serch for Google drive api
- select the first result
- Enable it.
- Click in navigation menu in top-left
- Click in APIs & Service > OAuth consent screen.
- In User Type select External and crate
- Insert a App name and put your email for suport and contact (logo and others things are not mandatory)
- In Scopes just click in Save and Continue.
- In Test User add if you want. In my case I didn't use.
- Check the summary and click in Back to Dashboard.
- Now go to Credentials in side bar.
- Create Credentials > OAuth client ID.
- Aplication Type: Desktop app.
- And name your OAuth 2.0 client.
- In OAuth 2.0 Client IDs click in Download OAuth client.
- Download JSON
- Place the JSON file in the same project folder
- rename the downloaded JSON to key.json (if you change the in the code, you can rename to the name you want!)
- To install the Google client library for Python, run the following command in terminal:
pip install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib
- After that, you need to put the spreadsheet ID in the .env file.
- To take your spreadsheet ID, go to the URL of the spreadsheet and take the code located on the pink spot in the next image:
- Then in the .env file put your Google account to send emails and the App password.
- Done!
This program need to be running all the time in the machine. If someone send a new application in Google Forms and the program is off, this person will never recive the confirmation email. (I'm working to fix that.)
Any questions or suggestions, please send me a message!