Permalink
Browse files

Add subscribe_sms command.

  • Loading branch information...
1 parent cc592bd commit 4820f1fba595373377160a08abf00a497996178e @pmac pmac committed Sep 7, 2012
Showing with 16 additions and 4 deletions.
  1. +1 −1 LICENSE
  2. +12 −0 basket/base.py
  3. +3 −3 setup.py
View
2 LICENSE
@@ -11,7 +11,7 @@ are permitted provided that the following conditions are met:
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- 3. Neither the name of jingo nor the names of its contributors may
+ 3. Neither the name of basket nor the names of its contributors may
be used to endorse or promote products derived from this software
without specific prior written permission.
View
12 basket/base.py
@@ -67,6 +67,18 @@ def subscribe(email, newsletters, **kwargs):
return request('post', 'subscribe', data=kwargs)
+def subscribe_sms(mobile_number, msg_name, optin=False):
+ """
+ Send SMS message `msg_name` to `mobile_number` and optionally add the
+ number to a list for future messages.
+ """
+ return request('post', 'subscribe_sms', data={
+ 'mobile_number': mobile_number,
+ 'msg_name': msg_name,
+ 'optin': 'Y' if optin else 'N',
+ })
+
+
def unsubscribe(token, email, newsletters=None, optout=False):
"""Unsubscribe an email from certain newsletters, or all of them
if `optout` is passed. Requires a token."""
View
6 setup.py
@@ -3,15 +3,15 @@
setup(
name='basket',
- version='0.2.0',
+ version='0.3.0',
description="A Python client for Mozilla's basket service",
long_description=open('README.rst').read(),
author='Michael Kelly',
author_email='mkelly@mozilla.com',
- license='GPL',
+ license='BSD',
packages=find_packages(exclude=['ez_setup']),
install_requires=['requests'],
- url='https://github.com/Osmose/basket-client',
+ url='https://github.com/mozilla/basket-client',
include_package_data=True,
classifiers=[
'Intended Audience :: Developers',

0 comments on commit 4820f1f

Please sign in to comment.