We're going to build an API that use Google App Script to send emails utilizing the Gmail API.
Prerequisites
- Basic JavaScript knowledge
- Basic API knowledge
- A Google Account
How to Build
- Open Google Sheets
- Now click on
Blank Spreadsheet
. - This will create a Blank Spreadsheet. In my case I am naming it
Email API
. - Now click on
Extensions
and then selectApps Script
. - Now it will open a code editor. Name your project if you want.
- Copy and paste the code from Github. Press
Ctrl + S
to save the code. -
You have to fill some details here.
- Description: Write anything you want
- Executes as : Me (your email)
- Who has access: Anyone
After filling details click on
Deploy
and authorize application.Now your project is deployed. Copy the URL and make a post request using postman or your project.
Make sure to include while making a POST
request.
Content-Type: JSON
{
"email":"",
"subject":"",
"body":""
}
Thanks for reading!
Top comments (0)