Skip to main content

Send SMS messages to mobile devices through Cafe24 SMS api.

Project description

Python 2 & 3 compatible

https://travis-ci.org/iumjjing/cafe24-sms-Django.svg?branch=master https://coveralls.io/repos/github/iumjjing/cafe24-sms-Django/badge.svg?branch=feature%2Ftravis

Installation

You can install the library directly from pypi using pip:

$ pip install cafe24-sms-Django

Edit your settings.py file:

CAFE24_SMS_SETTINGS = {
    # Required
    'USER_ID': 'Your cafe24 id',
    'SECURE_KEY': 'Your secure key',
    'SENDER': 'Your telephone number ex) 000-0000 or 000-0000-0000',

    # Optional (If you want using default value, delete lines)
    'REQUEST_TIMEOUT': 30.0,
    'TEST_MODE': False,
    'CHARSET': 'euc-kr',
    'TIMEZONE': 'Asia/Seoul',
}

Dependencies

  • Python 2.7 or 3.4+

  • Django 1.11+

Quickstart

Send sms message to use shortcut function

import cafe24_sms

try:
    # Send single SMS
    cafe24_sms.send_message(message='message', receiver='will receive telephone number or number list')

except SMSModuleException as e:
    print(e)
  • Send function returning Tuple(Result code, Remaining sms count)

  • If message byte length over 90, Message will be send lms type.

  • Receiver format: Single number(‘000-000-000’) or Number list([‘000-000-000’,’000-000-000’])

More usage

Send / Reserve SMS message

from django.utils import timezone

import cafe24_sms

try:
    # Reserve single SMS
    cafe24_sms.reserve_message(
        message='message',
        receiver='will receive telephone number or number list',
        reservation_time=timezone.now(),
    )

    # Send multiple SMS
    cafe24_sms.send_message(
        message='message',
        receiver=['telephone number', '...'],
    )

    # Reserve multiple SMS
    cafe24_sms.reserve_message(
        message='message',
        receiver=['telephone number', '...'],
        reservation_time=timezone.now(),
    )

    # Send message repeat 3 times, gap 15 minutes
    cafe24_sms.send_message(
        message='message',
        receiver='telephone number',
        rpt_num=3,
        rpt_time=15,
    )

except SMSModuleException as e:
    print(e)

Check the result of sent SMS.

from django.utils import timezone

import cafe24_sms

data = cafe24_sms.result_check(start_date=timezone.now())

total_count = data.get_total_count()
result_records = data.get_records()
  • If you need more detail, see method doc.

Contributors

See https://github.com/iumjjing/cafe24-sms-Django/graphs/contributors

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

cafe24_sms_Django-1.1.0-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file cafe24_sms_Django-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: cafe24_sms_Django-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.3

File hashes

Hashes for cafe24_sms_Django-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0c9f4c13b673f1a5631d1629c7d361a2a3958fac2d884972aa164ae04e12d0bc
MD5 0ede88cde3b36bb9e65ee483d9a2c3e7
BLAKE2b-256 bd355bf660a49ca9db75819218605837489440b03d42de64859f76edc230febe

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page