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
Subscribe to:
Post Comments (Atom)
Disable Billing
Search for Billing Manage billing accounts Go to MYPROJECTS CLICK ON THE 3 BUTTON Actions Then hit disable
-
Create a web site with main page of index.html and 2 other linked original content html pages At least 2 links to public web pages you di...
-
Assignment # 6 due 10/18/24 https://uconnstamfordslp.blogspot.com/p/assignment-exercise-python-datastore.html Recreate the app engine pr...
-
Your assigned language is: English Classroom blog: googleclouduconn.blogspot.com 8/31/2021, 8:08 PM Assignment 1 due 9/9/21 https...
No comments:
Post a Comment