Giter Club home page Giter Club logo

sms-nigeria-go's Introduction

sms-nigeria-go โ€” Send SMS to any Nigeria phone-number with ease

Build Status

Supported SMS vendors

Platform Integrated ?
Bulk Sms Nigeria YES
Sms Clone YES
Net Bulk SMS NO
Padisoft NO
Sms mobile 24 NO

Installation

go get github.com/d-sense/sms-nigeria-go

Usage

send SMS via Bulk_Sms_Nigeria service (first, open and redeem an account here to obtain credentials: https://www.bulksmsnigeria.com/)

// import the package
github.com/d-sense/sms-nigeria-go

// declare the notification service
var bulkSmsNigeria sms_nigeria_go.SmsController

// declare, initialize, and send data
data := &sms_nigeria_go.BulkSmsNigeriaNotification{
	Sender:    os.Getenv("SMS_SENDER"),
	Recipient: recipient,
	Body:      textMessage,
	ApiToken:  os.Getenv("BULK_SMS_NIGERIA_API_TOKEN"),
}

result, err := repo.SendBulkSmsNigeria(data)
if err != nil {
	log.Fatal(err)
}
fmt.Println(result)

send SMS via Sms_Cone service (first, open and redeem an account here to obtain credentials: http://smsclone.com)

// import the package
github.com/d-sense/sms-nigeria-go

// declare the notification service
var smsClone sms_nigeria_go.SmsController

// declare, initialize, and send data
smsCloneData := &sms_nigeria_go.SmsCloneNotification{
	Username:  os.Getenv("USERNAME"),
	Password:  os.Getenv("PASSWORD"),
	Sender:    os.Getenv("SMS_SENDER"),
	Recipient: recipient,
	Message:   textMessage,
}

result, err := repo.SendSmsClone(smsCloneData, sms_nigeria_go.SmsCloneNormalRoute)
if err != nil {
	log.Fatal(err)
}
fmt.Println(result)

// to check credit balance
credential := sms_nigeria_go.SmsCloneCredential{
	Username: os.Getenv("USERNAME"),
	Password: os.Getenv("PASSWORD"),
}

balance, err := repo.CheckBalanceSmsClone(&credential)
if err != nil {
	log.Fatal(err)
}
fmt.Println(balance)

Note that for Sms_Clone service, you can use different methods to send a SMS and ensure the message will be delivered. In my experience, "dnd-fallback" seems like the most reliable (charge varies per method though).

Method Constant
sendsms route SmsCloneNormalRoute
dnd-route SmsCloneDndRoute
dnd-fallback SmsCloneNormalAndDndRoute

License

License

sms-nigeria-go's People

Contributors

d-sense avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.