https://blog.mailtrap.io/send-emails-with-gmail-api/#Step_9_Read_a_specific_email_from_your_inbox
pip install -r requirements.txt
python getCredential.py
GMAIL_CLIENT_ID=<client_id>
GMAIL_CLIENT_SECRET=<client_secret>
GMAIL_REFRESH_TOKEN=<refresh_token>
https://developers.google.com/gmail/api/reference/rest/v1/users.messages#Message.MessagePart
docker build . -t ark-go-email
docker run -p 9000:8080 --env-file env.var ark-go-email:latest
curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}'
Follow this post to push it to ecr: https://dev.to/jiayanguo/another-milestone-of-aws-lambda-45f3
docker tag ark-go-email:latest 120400168286.dkr.ecr.us-west-2.amazonaws.com/ark-go-email:latest
aws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin 120400168286.dkr.ecr.us-west-2.amazonaws.com
docker push 120400168286.dkr.ecr.us-west-2.amazonaws.com/ark-go-email:latest
https://console.developers.google.com/
- Error 400: redirect_uri_mismatch The redirect URI in the request, http://localhost:49619/, does not match the ones authorized for the OAuth client. To update the authorized redirect URIs, visit: https://console.developers.google.com/apis/credentials/oauthclient/${your_client_id}?project=${your_project_number}
Edit the credential to add an authorised redirect URIs.
https://medium.com/@nakulkurane/sending-gmail-on-aws-lambda-via-python-a7fa991a97f1