Send With Confidence
Partner with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
Time to read: 1 minute
from flask import Flask, request | |
import json | |
from twilio.rest import TwilioRestClient | |
app = Flask(__name__) | |
@app.route('/',methods=['POST']) | |
def foo(): | |
account_sid = "Your Twilio Account SID" | |
auth_token = "Your Twilio Auth Token" | |
client = TwilioRestClient(account_sid, auth_token) | |
data = json.loads(request.data) | |
message = "Your email just got opened up by: {}".format(data[0]['email']) | |
message = client.messages.create(to="+13334445555", from_="+13334445555", body=message) | |
return "OK" | |
if __name__ == '__main__': | |
app.run() |
Partner with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.