- EmailAPI.py contains basic functions to send emails.
- rest_apis.py contains the restapi for sending email.
- Chalice is used to deploy on AWS.
- test_emails.py contains the unittests.
- create credentials.csv with below contents
Smtp Username,Smtp Password,SENDGRID_API_KEY,MAILGUN_API_KEY AWSUSERNAME,AWSSES_PWD,SEND KEY,MAINGUN_APIKEY
- /sendmail -- POST, Send email using stored credentials
- /sendmailaws -- POST, Send email using AWS credentials in POST parameters
- /sendmailsg -- Similar to above for SendGrid API TOKEN.
- /sendmailmg -- Similar to above for MailGun API TOKEN.
- Chalice for deploying on AWS.
- sendgrid, smtplib,requests, etc.
- httpie to debug AWS REST calls in cloud.
- AWS CloudWatch to monitor logs & calls.
- AWS Lambda, AWS Gateway & AWS SES for email service.
Chalice installs Python APP on AWS Lambda.
- pip install chalice -- to install chalice.
- chalice new-project -- to create new chalice project.
- chalice local -- to deploy services locally.
- chalice deploy -- to deploy on AWS cloud using AWS Lambda & Gateway.
- Run python rest_apis.py to get the local server IP. Ex: http://127.0.0.1:5000/
- In new terminal run curl command to invoke rest commands. Examples are in rest_commands.txt
- Type "chalice deploy" in "serverlessDeployment"
- Above command will create AWS lambda and provide the URI. use "https://2tzi8cc4uj.execute-api.us-west-2.amazonaws.com/api/sendmail"
Description of parameters.
- "service_provider" -- can be "MAILGUN", "AWSSES", or "SENDGRID",
- "sender" -- From email address.
- "recipient" -- To email address.
- "subject": -- Subject of email.
- "body": -- Body in a HTML format.