PureResponseClient
Python API wrapper for PureResponse PAINT by Pure360
For internal use and public release
MIT License (MIT)
Copyright (c) 2013 Triggered Messaging Ltd
Authored by Mikael Kohlmyr
========
Create a new contact list.
Will generate a contact list from a set of dictionaries.
from pypurepaint import PureResponseClient as Pure
pure = Pure()
pure.api_authenticate('username', 'password')
pure.api_create_contact_list('new_list_name', [{
'email' : '[email protected]'
, 'name' : 'John Doe'
}])
pure.api_invalidate()
Add a new contact (or several) to a list.
Any fields that don't already exist in the list will be ignored.
from pypurepaint import PureResponseClient as Pure
pure = Pure()
pure.api_authenticate('username', 'password')
pure.api_add_contact('contact_list_name', {
'email' : '[email protected]'
, 'name' : 'Jane Doe'
})
pure.api_add_contacts('contact_list_name', [{
'email' : '[email protected]'
, 'name' : 'Jack Doe'
}
, {
'email' : '[email protected]'
, 'name' : 'Jill Doe'
}]
)
pure.api_invalidate()
Create a new email message.
Will create an email that can be sent as a one-to-one message or a bulk campaign email.
from pypurepaint import PureResponseClient as Pure
pure = Pure()
pure.api_authenticate('username', 'password')
message_body = 'This is an <strong>example email</strong>'
pure.api_create_email('example_message_name', 'hello world', message_body)
pure.api_invalidate()
Send a one-to-one message.
Optionally supply custom merge fields for the recipient as a third parameter.
from pypurepaint import PureResponseClient as Pure
pure = Pure()
pure.api_authenticate('username', 'password')
pure.api_send_to_contact('[email protected]', 'example_message_name')
pure.api_invalidate()
Bulk campaign sending to a list
Will send a specified email message to a given list of recipients. Uses values found in the list data if possible, falling back to default values for custom fields if necessary.
from pypurepaint import PureResponseClient as Pure
pure = Pure()
pure.api_authenticate('username', 'password')
pure.api_send_to_list('example_list_name', 'example_message_name')
pure.api_invalidate()