def sendEmail(to,apNumber,paperType,zipedFile):
sg = sendgrid.SendGridAPIClient(apikey=os.environ.get("API-KEY"))
to_email = mail.Email( "[email protected]")
from_email = mail.Email( "[email protected]" )
subject = 'This is a test email'
content = mail.Content('text/plain', 'Example message.')
message = mail.Mail(from_email, subject, to_email, content)
response = sg.client.mail.send.post(request_body = message.get())
return response
Setup Environment Variables.
To Set up environment Variable follow the below 3 steps
echo "export SENDGRID_API_KEY='YOUR_API_KEY'" > sendgrid.env
echo "sendgrid.env" >> .gitignore
source ./sendgrid.env
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With