UCONN

UCONN
UCONN

Wednesday, July 28, 2021

Team Status updates due before meeting tomorrow, 7/28/2021, 6:50 PM, English, 7/28/2021, 6:50 PM

Your assigned language is: English
Classroom blog: googleclouduconn.blogspot.com

7/28/2021, 6:50 PM

Team leaders - Please send status update sheets in before tomorrow's meeting
I'm focusing on using sendgrid from twilio
Was able to send email using shell script

curl --request POST \
--url https://api.sendgrid.com/v3/mail/send \
--header 'Authorization: Bearer MY KEY' \
--header 'Content-Type: application/json' \
--data '{"personalizations":[{"to":[{"email":"john.iacovacci1@gmail.com","name":"John
Doe"}],"subject":"Hello, World!"}],"content": [{"type": "text/plain",
"value": "Heya!"}],"from":{"email":"jiacovacci@hotmail.com","name":"Sam
Smith"},"reply_to":{"email":"jiacovacci@hotmail.com","name":"Sam
Smith"}}'

And python script

# using SendGrid's Python Library
# https://github.com/sendgrid/sendgrid-python
import os
from sendgrid import SendGridAPIClient
from sendgrid.helpers.mail import Mail

message = Mail(
from_email='jiacovacci@hotmail.com',
to_emails='john.iacovacci1@gmail.com',
subject='Sending with Twilio SendGrid is Fun',
html_content='<strong>and easy to do anywhere, even with Python</strong>')
try:
sg = SendGridAPIClient(os.environ.get('SENDGRID_API_KEY'))
response = sg.send(message)
print(response.status_code)
print(response.body)
print(response.headers)
except Exception as e:
print(e.message)

https://docs.sendgrid.com/ui/account-and-settings/api-keys#storing-an-api-key-in-an-environment-variable

https://docs.sendgrid.com/for-developers/sending-email/quickstart-python

Working on app engine

Will try node first before python

https://cloud.google.com/community/tutorials/send-email-with-sendgrid-and-nodejs-on-google-app-engine

No comments:

Post a Comment

Disable Billing

Search for Billing Manage billing accounts Go to MYPROJECTS CLICK ON THE 3 BUTTON Actions Then hit disable