Library for using SendGrids newsletter api
Project description
# sendgrid-newsletter
This is a library to interact with the newsletter api built by sendgrid.
## Quick Usage Example
```python
import sendgridnewsletter.client import SendGridMarketing
sendgrid_username = 'someuser'
sendgrid_password = 'somepass'
client = SendGridMarketing(sendgrid_username, sendgrid_password)
# get all email lists
client.lists.all()
# create a list
client.lists.add('listname')
# delete a list
client.lists.delete('listname')
# rename a list
client.lists.rename('oldname', 'newname')
# get a specific list
list = client.lists.get_list('somename')
# get all emails in a list
emails = list.emails()
# check for specific email in list
list.has_email('name@example.com')
# add a single email address
list.add_email('name@example.com', 'name')
# add multiple emails
emails = [
{'email': 'email1@example.com', 'name': 'email name'},
{'email': 'email2@example.com', 'name': 'name email'}]
list.add_emails(emails)
# delete a specific email
list.delete_email('email@example.com
```
## Features
Attempts to make the API more usable.
This is a library to interact with the newsletter api built by sendgrid.
## Quick Usage Example
```python
import sendgridnewsletter.client import SendGridMarketing
sendgrid_username = 'someuser'
sendgrid_password = 'somepass'
client = SendGridMarketing(sendgrid_username, sendgrid_password)
# get all email lists
client.lists.all()
# create a list
client.lists.add('listname')
# delete a list
client.lists.delete('listname')
# rename a list
client.lists.rename('oldname', 'newname')
# get a specific list
list = client.lists.get_list('somename')
# get all emails in a list
emails = list.emails()
# check for specific email in list
list.has_email('name@example.com')
# add a single email address
list.add_email('name@example.com', 'name')
# add multiple emails
emails = [
{'email': 'email1@example.com', 'name': 'email name'},
{'email': 'email2@example.com', 'name': 'name email'}]
list.add_emails(emails)
# delete a specific email
list.delete_email('email@example.com
```
## Features
Attempts to make the API more usable.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for sendgrid-newsletter-0.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | be966528335c4744f0cfcb1ae535bd7e36ee89a867396adb98f261f217ed4c0a |
|
MD5 | 03da636f36fa1acea2bf68c8259a576d |
|
BLAKE2b-256 | ca44f180c77ec34929b289d1af6ce18bd7ee8c7810c365a54a54d4b73fb88591 |