Skip to content

Latest commit

 

History

History
16 lines (10 loc) · 549 Bytes

twilio-email.md

File metadata and controls

16 lines (10 loc) · 549 Bytes

First, follow the Twilio Setup guide for creating a Twilio account and setting up environment variables with the proper credentials.

Then, initialize the Twilio Email Client.

import sendgrid
import os

mail_client = sendgrid.TwilioEmailAPIClient(os.environ.get('TWILIO_API_KEY'), os.environ.get('TWILIO_API_SECRET'))

# or

mail_client = sendgrid.TwilioEmailAPIClient(os.environ.get('TWILIO_ACCOUNT_SID'), os.environ.get('TWILIO_AUTH_TOKEN'))

This client has the same interface as the SendGridAPIClient client.