An open API service indexing awesome lists of open source software.

https://github.com/johnvuko/validates_email_format_of

A plugin for validate format of email and blacklist some domains.
https://github.com/johnvuko/validates_email_format_of

Last synced: about 1 year ago
JSON representation

A plugin for validate format of email and blacklist some domains.

Awesome Lists containing this project

README

          

validates_email_format_of
======================

A plugin for validate format of email and blacklist or whitelist some domains.

Installation
------------

Include the gem in your Gemfile:

gem 'validates_email_format_of', :git => 'https://github.com/jonathantribouharet/validates_email_format_of'

Usage
-----

In your model:

class User < ActiveRecord::Base
validates :email, :email => true
end

Or

class User < ActiveRecord::Base
validates_email_format_of :email
end

For blacklist or whitelist some domains add in a initializer:

EmailValidator.blacklist_domains = ['yopmail.com', 'jetable.org']
EmailValidator.whitelist_domains = ['gmail.com', 'hotmail.com']

I18n support
------------

* `errors.messages.not_an_email_adress` is used for an invalid format
* `errors.messages.not_a_valid_email_adress` is used for an invalid domain

Warning
-------

The validation downcase the email.