Giter VIP home page Giter VIP logo

postmonkey's People

Contributors

dhhagan avatar ericrasmussen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

postmonkey's Issues

Bool response is not handled correctly.

In [17]: p.listSubscribe(id=lists['data'][0]['id'], email_address='[email protected]')
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
/../eggs/Django-1.4-py2.7.egg/django/core/management/commands/shell.pyc in <module>()
----> 1 p.listSubscribe(id=lists['data'][0]['id'], email_address='[email protected]')

/../eggs/postmonkey-1.0a2-py2.7.egg/postmonkey/__init__.pyc in _make_method_call(self, methodname, **kwargs)
     90             raise PostRequestError(e)
     91 
---> 92         decoded = self._deserialize_response(resp.text)
     93         return decoded
     94 

/../eggs/postmonkey-1.0a2-py2.7.egg/postmonkey/__init__.pyc in _deserialize_response(self, text)
    123             raise DeserializationError(text)
    124 
--> 125         self._fail_if_mailchimp_exc(deserialized)
    126 
    127         return deserialized

/../eggs/postmonkey-1.0a2-py2.7.egg/postmonkey/__init__.pyc in _fail_if_mailchimp_exc(self, response)
    133         error returned by MailChimp.
    134         """
--> 135         if 'code' in response and 'error' in response:
    136             raise MailChimpException(response['code'], response['error'])
    137 

TypeError: argument of type 'bool' is not iterable

Not quoted payload values prevent emails with '+' from being subscribed to MailChimp

When trying to subscribe email with '+' character, getting exception:

Traceback (most recent call last):
  File "postmonkey/__init__.py", line 92, in _make_method_call
    decoded = self._deserialize_response(resp.text)
  File "postmonkey/__init__.py", line 125, in _deserialize_response
    self._fail_if_mailchimp_exc(deserialized)
  File "postmonkey/__init__.py", line 140, in _fail_if_mailchimp_exc
    raise MailChimpException(response['code'], response['error'])
MailChimpException: MailChimp error code 502: "Invalid Email Address: test 01@te
st.com"

Please note, that '+' character is just replaced with space, which is obviously invalid.

The same thing happens when trying to get e.g. lists for email with '+' character.

How to handle Merge vars

How does one handle merge vars with this? Mailchimp API is kind of silly in that the merge vars has to be sent not as a dictionary, but as separate keywords, and one can't send the following as a keyword argument due to [ and ].

merge_vars[FNAME] = "FOOBAR"

instead of merge_vars = {"FNAME": "FOOBAR"}

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.