Skip to content

Conversation

mercywangara
Copy link
Collaborator

@mercywangara mercywangara commented Sep 29, 2025

Description

This pull request adds SMS sending functionality to the MlimiZone USSD project and corrects a typo in the settings file. The new sms.py module integrates with the SMSLeopard API to send SMS messages, enabling notifications for user registration, produce listings, and payments. The settings.py file is updated to include SMS credentials and fix the typo ALLOWED_ADMIN_IDENTIFIRES to ALLOWED_ADMIN_IDENTIFIERS, ensuring proper admin identifier configuration.

  • What is this?: This is the addition of an SMS helper module (sms.py) and a settings update to support SMS notifications in the USSD system.
  • Why this?: SMS notifications are essential for user engagement (e.g., confirming registrations, orders) in a USSD-based agricultural marketplace, improving user experience and operational efficiency.
  • How am I doing this?: The sms.py file uses the requests library and base64-encoded credentials to call the SMSLeopard API. Settings are updated with environment variables for USERNAME_SMS, PASSWORD, and SOURCE, loaded via dotenv.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Optimization
  • Improvement
  • Bug fix

How Has This Been Tested?

  • Test A - Manually tested SMS sending by running python mlimi_zone/sms.py <phone_number> <message> with a valid phone number and message, verifying the API response (status code 200) and receiving the SMS.
  • Test B - Integrated send_sms into the USSDView (e.g., registration flow) and confirmed SMS delivery for a new user registration using a test phone number.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@jmwai jmwai merged commit b8e803d into develop Sep 30, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants