Skip to content

Latest commit

 

History

History
38 lines (24 loc) · 920 Bytes

README.md

File metadata and controls

38 lines (24 loc) · 920 Bytes

This library allows you to quickly and easily use the SendGrid Web API via Python.

This library uses the Sendgrid v2 Web API.

Installation

Download and extract to your project folder.

Quick Start

Setup your credentials

Set your API KEY and Sender Details (If sender is constant) in credentials.py file inside the sendgrid folder.

SENDGRID_API_KEY = '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'
FROM_NAME = 'Sender'
FROM_EMAIL = '[email protected]'

v2 Mail Send endpoint (Send an Email)

from sendgrid import *

send_via_sendgrid(
    receiver=[{'email': '[email protected]', 'name': 'John Doe'}], 
    subject='This is a Subject', 
    html='Html Body',
    plain_text='Text Body', 
    from_name='Dave Doe',
    sender_email='[email protected]',
    reply_to='[email protected]'):