A Django app to send sms with skebby
Project description
django-skebby
===================
A simple Django app to send sms with Skebby.
Usage
-----
In settings.py:
SKEBBY_USERNAME = 'yourskebbyusername'
SKEBBY_PASSWORD = 'yourskebbypassword'
In your code:
from django_skebby.utils import Sms, credit_left
# greetings to some people
sms = Sms("Good {{ festivity }}{% if friend %} {{ friend }}{% endif %}!", ["39123456789", "3912346788"], sender_string="Your friend", ctx={'festivity': 'birthday'})
ret = sms.send()
# api request are splitted by Skebby recipients limits, 50000 default, 100000 if requested
failed_requests = [r for r in ret['body'] if r['error']]
if failed_requests:
print "some errors!"
# to a special friend
r = sms.send_single({'festivity': birthday, 'friend': 'Doge' }, "3912345679")
if r['error']:
print "failed to greet :( %s" % (r['error_message'])
# check credit
credit = credit_left()
if credit['error']:
print "failed to get credit"
else:
print credit['body']
===================
A simple Django app to send sms with Skebby.
Usage
-----
In settings.py:
SKEBBY_USERNAME = 'yourskebbyusername'
SKEBBY_PASSWORD = 'yourskebbypassword'
In your code:
from django_skebby.utils import Sms, credit_left
# greetings to some people
sms = Sms("Good {{ festivity }}{% if friend %} {{ friend }}{% endif %}!", ["39123456789", "3912346788"], sender_string="Your friend", ctx={'festivity': 'birthday'})
ret = sms.send()
# api request are splitted by Skebby recipients limits, 50000 default, 100000 if requested
failed_requests = [r for r in ret['body'] if r['error']]
if failed_requests:
print "some errors!"
# to a special friend
r = sms.send_single({'festivity': birthday, 'friend': 'Doge' }, "3912345679")
if r['error']:
print "failed to greet :( %s" % (r['error_message'])
# check credit
credit = credit_left()
if credit['error']:
print "failed to get credit"
else:
print credit['body']
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-skebby-0.2.1.tar.gz
(4.5 kB
view details)
File details
Details for the file django-skebby-0.2.1.tar.gz
.
File metadata
- Download URL: django-skebby-0.2.1.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bdf0b7b6bfae89b37dbe7a96fc995cb9e6b4cbfdaedb56229da6ab5a4dc484fd |
|
MD5 | 01ddd63861908f8f7175b1a5bdfcd737 |
|
BLAKE2b-256 | c41d7d3f07116b2cdbc5a7bcccb39a14930d995b130f9f4c1e74d0de6482156a |