Skip to content

dlinsg/smtpapi-python

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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()
header.add_to('email@email.com')
header.set_tos(['email@email.com'])
header.add_substitution('key', 'value')
header.set_substitutions({'key': ['value1', 'value2']})
header.add_unique_arg('key', 'value')
header.set_unique_args({'key':'value'})
header.add_category('category')
header.set_categories(['category1', 'category2'])
header.add_section('key', 'section')
header.set_sections({'key1':'section1', 'key2':'section2'})
header.add_filter('filter', 'setting', 'value')

Get Headers

header.json_string()

MIT

About

Build SendGrid X-SMTPAPI headers in python

Resources

Stars

Watchers

Forks

Packages

No packages published