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

adonisjs-infobip

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

adonisjs-infobip

An addon/plugin package to provide InfoBip single/bulk SMS/Voice services in AdonisJS 4.0+

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
Maintainers
1
Weekly downloads
 
Created
Source

adonis-infobip

An addon/plugin package to provide InfoBip single/bulk SMS/Voice/WebRTC services in AdonisJS 4.0+

NPM Version Build Status Coveralls

Getting Started

Install from the NPM Registry


   $ adonis install adonisjs-infobip

Usage

Import and use


  'use strict'
  
  const Infobip = use('InfoBip')
  
  class MessageController {
  
      constructor(User){
          this.user = User
      }
      
      static get inject(){
          return [
              'App/Models/User'
          ]
      }
      
      async sendOneSms({ request, response }){

          let user = await this.user.find(1) // get user from database

          let response = await Infobip.sendSMS({
            messages: [{
              destinations: [{
                to: String(user.phone_number)
              }],
              from:"MESSANGER-NG",
              text:`Hello ${user.full_name}, Happy birthday!`
            }]
          })

          console.log("Bulk ID: ", response.body.bulkId)

          return response.status(200).json({
            status: 'success',
            data: `Message sent to ${user.full_name}`
          })
      }
  }
  
  module.exports = MessageController

License

MIT

Running Tests


    npm i


    npm run lint

    npm run test

Credits

Contributing

See the CONTRIBUTING.md file for info

Keywords

FAQs

Package last updated on 27 Mar 2022

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