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

kickbox_rails

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kickbox_rails

  • 1.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

KickboxRails

Validate emails using Kickbox.io API in Ruby on Rails and fallback to basic syntax email validation if Kickbox.io API fails for any reason

Installation

Add this line to your application's Gemfile:

gem 'kickbox_rails'

And then execute:

$ bundle

Execute next command for generate initializer kickbox_rails.rb, where you can configure your kickbox.io account api_key:

$ rails g kickbox_rails:install

Usage

# Rails
class Person < ActiveRecord::Base
  validates_kickbox_email_format :email
  # OR
  validates :email, kickbox_email_format: { message: 'Email is invalid' }
end

# Non Rails
KickboxRails.valid?("example@email.com")
KickboxRails.invalid?("example@email.com")

If you want to get related info from kickbox.io API use validate method

KickboxRails.validate("bill.lumbergh@gamil.com") =>

{
  "result":"invalid",
  "reason":"rejected_email",
  "role":false,
  "free":false,
  "disposable":false,
  "accept_all":false,
  "did_you_mean":"bill.lumbergh@gmail.com",
  "sendex":0,
  "email":"bill.lumbergh@gamil.com",
  "user":"bill.lumbergh",
  "domain":"gamil.com",
  "success":true,
  "message":null
}

Contributing

  1. Fork it ( http://github.com/the-cocktail/kickbox_rails/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

FAQs

Package last updated on 09 Oct 2015

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