Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add subscribe_sms command.

  • Loading branch information...
commit 4820f1fba595373377160a08abf00a497996178e 1 parent cc592bd
Paul McLanahan pmclanahan authored

Showing 3 changed files with 16 additions and 4 deletions. Show diff stats Hide diff stats

  1. +1 1  LICENSE
  2. +12 0 basket/base.py
  3. +3 3 setup.py
2  LICENSE
@@ -11,7 +11,7 @@ are permitted provided that the following conditions are met:
11 11 notice, this list of conditions and the following disclaimer in the
12 12 documentation and/or other materials provided with the distribution.
13 13
14   - 3. Neither the name of jingo nor the names of its contributors may
  14 + 3. Neither the name of basket nor the names of its contributors may
15 15 be used to endorse or promote products derived from this software
16 16 without specific prior written permission.
17 17
12 basket/base.py
@@ -67,6 +67,18 @@ def subscribe(email, newsletters, **kwargs):
67 67 return request('post', 'subscribe', data=kwargs)
68 68
69 69
  70 +def subscribe_sms(mobile_number, msg_name, optin=False):
  71 + """
  72 + Send SMS message `msg_name` to `mobile_number` and optionally add the
  73 + number to a list for future messages.
  74 + """
  75 + return request('post', 'subscribe_sms', data={
  76 + 'mobile_number': mobile_number,
  77 + 'msg_name': msg_name,
  78 + 'optin': 'Y' if optin else 'N',
  79 + })
  80 +
  81 +
70 82 def unsubscribe(token, email, newsletters=None, optout=False):
71 83 """Unsubscribe an email from certain newsletters, or all of them
72 84 if `optout` is passed. Requires a token."""
6 setup.py
@@ -3,15 +3,15 @@
3 3
4 4 setup(
5 5 name='basket',
6   - version='0.2.0',
  6 + version='0.3.0',
7 7 description="A Python client for Mozilla's basket service",
8 8 long_description=open('README.rst').read(),
9 9 author='Michael Kelly',
10 10 author_email='mkelly@mozilla.com',
11   - license='GPL',
  11 + license='BSD',
12 12 packages=find_packages(exclude=['ez_setup']),
13 13 install_requires=['requests'],
14   - url='https://github.com/Osmose/basket-client',
  14 + url='https://github.com/mozilla/basket-client',
15 15 include_package_data=True,
16 16 classifiers=[
17 17 'Intended Audience :: Developers',

0 comments on commit 4820f1f

Please sign in to comment.
Something went wrong with that request. Please try again.