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

mailgun_email_validator

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mailgun_email_validator

  • 0.1.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

mailgun_email_validator

This gem adds a validates_as_email_with_mailgun method to ActiveRecord. It first tries to verify an e-mail using the amazing Mailgun e-mail validation API and then falls back to using the spectator_validates_email gem if it can't connect.

Usage

Add the gem to your Rails project's Gemfile, then bundle install to get started.

gem 'mailgun_email_validator'

You'll need to add a MAILGUN_PUBLIC_KEY environmental variable to your system, for instance in your ~/.bash_profile:

export MAILGUN_PUBLIC_KEY='f23oifj3ojo2j3ofj32ijoj2iojf3iojoi2f32'

Alternatively, you can configure mailgun with an initializer:

In config/initializers/mailgun_email_validator.rb:

MailgunEmailValidator.mailgun_public_key = 'f23oifj3ojo2j3ofj32ijoj2iojf3iojoi2f32'

Note: This is not a real Mailgun public key

To use mailgun_email_validator inside your models:

validates_as_email_with_mailgun :email

You can also specify many of the usual ActiveRecord validation options including :on, :allow_nil, :allow_blank, and :message.

There is also a helper method available on all models:

MyModel#valid_email_with_mailgun?(email) => true/false

Contributing to mailgun_email_validator

Pull requests welcome.

  • Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
  • Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
  • Fork the project.
  • Start a feature/bugfix branch.
  • Commit and push until you are happy with your contribution.
  • Make sure to add tests for it. This is important so we don't break it in a future version unintentionally.
  • Send in a pull request!

Credits

FAQs

Package last updated on 12 Dec 2014

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