Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

idi_sms

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

idi_sms

  • 0.4.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

idi_sms Gem

Overview

The idi_sms gem is a Ruby library that simplifies the process of sending SMS messages using the 8070 short code SMS-Gateway API. This gem is specifically designed for integration with the PITB Dengue Tracking System, allowing you to send SMS messages efficiently and seamlessly.

Installation

To use the idi_sms gem in your project, follow these steps:

  1. Add the gem to your project's Gemfile:

    gem 'idi_sms'
    

Run bundle install to install the gem and its dependencies.

  1. Run Command to generate yml file for setting key:

    $ rails generate idi_sms:config
    

it will create a file on config/idi_sms.yml

  1. Set your api_url and secret_key as per your envionrment
    1. api_url: your_sender_url
    2. secret_key: your_secret_key

Usage

Require the gem in your Ruby code:
require 'idi_sms'

sms_sender = IdiSms::SmsSender.new


Customize your SMS details, including the phone number, SMS text, and SMS language:

phone_no = 'xxxxxxxxxx'(allow number only)
sms_text = 'This gem created by idi'
sms_language = 'english'


Send an SMS using the send_sms method and handle the response:


result = sms_sender.send_sms(phone_no, sms_text, sms_language)
puts result

Response

SUCCESS Response:


  {
    "status": "success",
    "message": "sent to SMS Provider for broadcast."
  }

Error Response:

  {
    "status": "error",
    "message": "Phone Number is Missing"
  }

  {
    "status": "error",
    "message": "SMS text is missing"
  }

  {
    "status": "error",
    "message": "Phone Number should contains only digits & length equals to 11."
  }

  {
    "status": false,
    "error": "Invalid API Key."
  }

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

The idi_sms gem is released under the MIT License. See the LICENSE file for details.

Contact If you have any questions or encounter issues with the idi_sms gem, feel free to contact idrees.ibrahim009@gmail.com.

In the provided text, I added instructions for generating an API key and setting environment variables. Please customize it further with the actual URLs, environment variable names, and any additional details specific to your gem.

FAQs

Package last updated on 25 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc