Code Monkey home page Code Monkey logo

pypurepaint's Introduction

PyPurePaint

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

Triggered Messaging,
Pure360

======== 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()

pypurepaint's People

Stargazers

Alfonso de la Osa avatar

Watchers

Alfonso de la Osa avatar David Henderson avatar James Cloos avatar Andrew Gretton avatar

Forkers

konnectdata

pypurepaint's Issues

Searches may not return in order of relevance

It would be worthwhile going over the code to double-check how search results are being dealt with, ensuring consistency and accuracy (selecting the correct result which may or may not be the first one)

_build_contact_entity count 0 disregarded, 1 breaks

Both when using the api to append to a list as well as upload data to a newly created list, the Pure360 API completely disregards field0 when generating lists and if the count starts at 1 (field1) the newly generated list / entries will not be processed period.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.