Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Build SendGrid X-SMTPAPI headers in python
Python
Branch: master
Failed to load latest commit information.
smtpapi Added IP Pools
test Added IP Pools
.gitignore Ignore venv folders
.travis.yml add hipchat
MANIFEST.in Added manifest
README.md Update README.md
setup.py Version bump v0.3.0

README.md

SMTPAPI for Python

This module will let you build SendGrid's SMTP API headers with simplicity.

Installing

pip install smtpapi

Examples

Create headers

from smtpapi import SMTPAPIHeader

header = SMTPAPIHeader()

To

header.add_to('email@email.com')
header.set_tos(['email@email.com'])

Substitutions

header.add_substitution('key', 'value')
header.set_substitutions({'key': ['value1', 'value2']})

Unique Arguments

header.add_unique_arg('key', 'value')
header.set_unique_args({'key':'value'})

Categories

header.add_category('category')
header.set_categories(['category1', 'category2'])

Sections

header.add_section('key', 'section')
header.set_sections({'key1':'section1', 'key2':'section2'})

Filters

header.add_filter('filter', 'setting', 'value')

ASM Group ID

header.set_asm_group_id(value)

IP Pools

header.set_ip_pool("testPool")

Scheduling Parameters

header.add_send_each_at(unix_timestamp)
header.set_send_each_at([])
header.set_send_at(unix_timestamp)

Get Headers

header.json_string()

Deploying

  • Confirm tests pass
  • Bump the version in setup.py
  • Update CHANGELOG.md
  • Confirm tests pass
  • Commit Version bump vX.X.X
  • python setup.py sdist bdist_wininst upload
  • Push changes to GitHub
  • Release tag on GitHub vX.X.X

MIT

Something went wrong with that request. Please try again.