New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

zenvia-rest-rails

Package Overview
Dependencies
Maintainers
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zenvia-rest-rails

  • 0.2.5
  • Rubygems
  • Socket score

Version published
Maintainers
3
Created
Source

Zenvia Rest Rails

Ruby API to send sms with Zenvia's REST Api, based on https://github.com/lmorais/zenvia-ruby

Download and Install

gem install zenvia-rest-rails

or on your Gemfile:

gem "zenvia-rest-rails"

and

bundle install

create zenvia config initializer

rails g zenvia:install

after config file created (config/initializers/zenvia.rb), you should define config params:


require 'zenvia'

Zenvia.configure do |config|
  config.account  = ENV['ZENVIA_ACCOUNT']
  config.code     = ENV['ZENVIA_CODE']
  config.from     = 'name of message sender. Ex. MY BUSINESS'
  config.callbackOption = 'zenvia callback option. default is NONE'
end

Usage


require 'zenvia'

# Sending a SMS

sms = Zenvia::Sms.new('your-sms-id', 'test message!', '5591999999999')

sms.send

You can also add two more parameters on 'send' method:

  1. schedule_date: String or DateTime
  2. aggregateId: String

require 'zenvia'

# Sending a SMS with schedule_date and aggregateId

sms = Zenvia::Sms.new('your-sms-id', 'test message!', '5591999999999', '2016-11-22T18:13:00', '111')

sms.send

Send Return


{"statusCode"=>"00",
 "statusDescription"=>"Ok",
 "detailCode"=>"000",
 "detailDescription"=>"Message Sent"}

For more information about returned codes: http://docs.zenviasmsenus.apiary.io/#introduction/status-table

Contributing to zenvia-rest-rails

  1. Fork the project.
  2. Start a feature/bugfix branch.
  3. Commit and push until you are happy with your contribution.
  4. Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.

See LICENSE.txt for further details.

FAQs

Package last updated on 22 Nov 2016

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