# HG changeset patch # User Oscar Cortez # Date 1538702009 21600 # Thu Oct 04 19:13:29 2018 -0600 # Node ID a94b39bff9da42219ee0789960b52a89b72ee9ee # Parent a0f27df3435f538e412f3e3c5dbb2c470827858d Bump version, update badge url and show Py2 support diff --git a/README.rst b/README.rst --- a/README.rst +++ b/README.rst @@ -1,17 +1,17 @@ -.. |nlshield| image:: https://img.shields.io/badge/100%-Netlandish-blue.svg?style=square-flat +.. |nlshield| image:: https://img.shields.io/badge/100%25-Netlandish-blue.svg?style=square-flat :target: http://www.netlandish.com ============================== sendypy |nlshield| ============================== :Info: Simple module to interface with the Sendy API (https://sendy.co/api) -:Version: 0.1.3b +:Version: 0.1.5b :Author: Peter Sanchez (http://www.petersanchez.com) - (http://www.netlandish.com) Dependencies ============ -* It was written for Python 2.7+ +* It was written for Python 2.7+ and Python 3.7+ * Depends on the requests module **NOTE:** @@ -44,15 +44,26 @@ from sendy.api import SendyAPI api = SendyAPI(host='https://your-sendy-install.com/sendy/', api_key='YOUR_API_KEY') -You don't need to set the api_key variable if you're using the +You don't need to set the api_key variable if you're using the subscribe or unsubscribe methods. You can also provide the optional -"debug" variable (defaults to False). This will print debug into to +"debug" variable (defaults to False). This will print debug into to stdout when sending a request to your Sendy install. **Subscribe** :: api.subscribe('list_id_here', 'email@address.com', 'optional first name', custom_field_1='value', custom_field_2='value', ...) +*Optional fields* + +- `country`: User's 2 letter country code. +- `ipaddress`: User's IP address. +- `referrer`: The URL where the user signed up from. +- `gdpr`: If you're signing up EU users in a GDPR compliant manner. +- `hp`: Include this 'honeypot' field to prevent spambots. + + data = {"gdpr": True, "ipaddress": "127.0.0.1", "country": "US"} + + api.subscribe(list_id, email, **data) **Unsubscribe** :: diff --git a/sendy/__init__.py b/sendy/__init__.py --- a/sendy/__init__.py +++ b/sendy/__init__.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -VERSION = (0, 1, 4, 'beta', 0) +VERSION = (0, 1, 5, 'beta', 0) def get_version(): diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -25,7 +25,8 @@ 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python', - 'Programming Language :: Python :: 3.7.0', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3.7', 'Environment :: Web Environment', ], include_package_data=True,