normalize_email 
Normalize emails for uniqueness validation. This will convert the email to lowercase, remove dots (.), and plus signs followed by arbitrary strings (+foobar).
Installation
Add normalize_email to your list of dependencies in mix.exs
def deps do
[{:normalize_email, "~> 0.0.1"}]
endEnsure normalize_email is started before your application
def application do
[applications: [:normalize_email]]
endUsage
NormalizeEmail.normalize_email("johnotander+foobar@gmail.com")
# => "johnotander@gmail.com"
NormalizeEmail.normalize_email("JOHN.OT.ander+OHAI@gmail.com")
# => "johnotander@gmail.com"Development
mix testRelated
-
Elixir port from the
normalize-emailnode module.
License
MIT
Contributing
- Fork it
-
Create your feature branch (
git checkout -b my-new-feature) -
Commit your changes (
git commit -am 'Add some feature') -
Push to the branch (
git push origin my-new-feature) - Create new Pull Request
Crafted with <3 by John Otander (@4lpine).