Skip to content

Latest commit

 

History

History
32 lines (25 loc) · 1005 Bytes

README.md

File metadata and controls

32 lines (25 loc) · 1005 Bytes

Sendgrid Python Examples

Check out the Blog Post

Set up your SendGrid account

  1. Create a sendgrid account
  2. Make sure you go through all the steps to set up a verified sender
  3. Create a restricted API key and enable the needed permissions
  4. Create an unsubscribe group
  5. Create a dynamic template

Running the examples locally

  1. Clone the repository
  2. Create a .env file with the following variables
SEND_GRID_API_KEY=<YOUR API KEY HERE>
FROM_EMAIL=<YOUR FROM EMAIL HERE>
TO_EMAIL=<YOUR TO EMAIL HERE>
UNSUBSCRIBE_GROUP_ID=<YOUR GROUP ID HERE>
DYNAMIC_TEMPLATE_ID=<YOUR DYNAMIC TEMPLATE ID HERE>
  1. Create a virtual environment with venv: python3 -m venv venv
  2. Activate the virtual environment: source ./venv/bin/activate
  3. Install packages pip install -r requirements.txt
  4. Run the desired example (e.g. python examples-python/send-basic.py)