PartnerFriendly
Are you a marketer? PartnerFriendly is for you.
When savvy users register for applications, they append their email with strings like "+yourapp" preceding their domain.
Users do this to identify your organization if they receive unsolicited email from one of your marketing partners, such as a co-branded newsletter.
PartnerFriendly neutralizes this issue by removing such identifiers, transforming
--->
upon entry to your database.
Installation
Add to your application's Gemfile:
gem 'partner_friendly'
Then execute:
$ bundle
Or install it yourself as:
$ gem install partner_friendly
Usage
In your User model, add:
...
before_validation :clean
...
def clean
PartnerFriendly::Process.clean(self)
end
FAQ
The user may try to trick the system with multiple identifiers,
however this just yields:
ProTip: opting for before_save or before_create instead of before_validation may throw a nasty database error:
In this case, simply rescue from the error with a redirect or existing authentication flash for "user already exists."
Contributing
Bug reports and pull requests are welcome.
- Fork it ( http://github.com/ryanckulp/partnerfriendly/fork )
- 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
License
The gem is available as open source under the terms of the MIT License.