Metadata-Version: 2.1
Name: onfon-sms-sender
Version: 0.1.2
Summary: A package to send SMS using Onfon Media API
Home-page: https://github.com/antonnifo/Onfon-SMS-Sender
Author: Antonnifo
Author-email: antonnifo@live.com
License: MIT
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests
Requires-Dist: python-dotenv

# Onfon-SMS-Sender
A Python package to send SMS using the Onfon Media API.


## Installation

```
pip install onfon-sms-sender

```


## Configuration
The package requires the following configuration variables:

- SMS_API_URL
- SMS_CLIENT_ID
- SMS_API_KEY
- SMS_SENDER_ID

### Using Environment Variables
Create a .env file in your project root with the following content:
```
SMS_API_URL=https://api.onfonmedia.co.ke/v1/sms/SendBulkSMS
SMS_CLIENT_ID=your_client_id_here
SMS_API_KEY=your_api_key_here
SMS_SENDER_ID=Aqila-Alert
```


### Using Django Settings
Alternatively, you can set these variables in your Django settings.py file:

```
# settings.py
SMS_API_URL = 'https://api.onfonmedia.co.ke/v1/sms/SendBulkSMS'
SMS_CLIENT_ID = 'your_client_id_here'
SMS_API_KEY = 'your_api_key_here'
SMS_SENDER_ID = 'Your Sender ID'
```

## Usage

```
from onfon_sms_sender import send_sms

recipients = ["254700000001", "0700000002"] #put your phone numbers here using the format 254 or 07...
message = "Hello, this is a test message from Onfon Media API"
response = send_sms(recipients=recipients, message=message)
print(response)
```


## Running Tests
To run tests, ensure you have set the necessary environment variables or updated your `settings.py` file.

```
python -m unittest discover
```
