sparkpost.suppression_list¶
-
class
sparkpost.suppression_list.SuppressionList(base_uri, api_key, transport_class=<class 'sparkpost.base.RequestsTransport'>)¶ SuppressionList class used to search, get and modify suppression status. For detailed request and response formats, see the Suppresion List API documentation.
-
create(entry)¶ Create a suppression list entry.
Parameters: status (dict|list) – If dict it is a single entry to create { 'email': 'test@test.com', 'transactional': True, 'non_transactional': True, 'description': 'Test description' }, if list it is multiple entries to createReturns: a dictwith a messageRaises: SparkPostAPIExceptionif API call fails
-
delete(email)¶ Delete the suppression status for a specific recipient by email
Parameters: email (str) – Email of the recipient whose status you want to remove Returns: TODO Raises: SparkPostAPIExceptionif API call fails
-
get(email)¶ Retrieve a suppression list entry for a specific recipient by email
Parameters: email (str) – Email of the recipient whose status you want to check_status Returns: a suppression list entry Raises: SparkPostAPIExceptionif API call fails
-
list(**kwargs)¶ List supression list entries based on the supplied parameters
Parameters: - from_date (datetime) – DateTime to start listing
- to_date (datetime) – DateTime to end listing
- types (list) – Types of entries to return
- limit (int) – Maximum number of entries to return
Returns: a
listof entriesRaises: SparkPostAPIExceptionif API call fails
-
update(entry)¶ Update a suppression list entry.
Parameters: status (dict|list) – If dict it is a single entry to update { 'email': 'test@test.com', 'transactional': True, 'non_transactional': True, 'description': 'Test description' }, if list it is multiple entries to updateReturns: a dictwith a messageRaises: SparkPostAPIExceptionif API call fails
-