tomichj / invitation

A Rails gem that can send 'scoped' invitations
MIT License
77 stars 28 forks source link

Add case_sensitive_email configuration option #7

Closed conarro closed 7 years ago

conarro commented 7 years ago

Set via Invitation.configuration.case_sensitive_email, this option makes it possible to disable case-sensitivity when inviting users.

Using the default of true is the same as the library's implicit behavior, which will not detect existing users if the email case does not match.

Example: a user exists with email user@example.com. An invitation is sent to User@example.com. By default, this will send the user the "new user" version of the invitation email, when really they should receive the "existing user" version.

Setting this option to false will disregard case when checking for existing recipients.

tomichj commented 7 years ago

Hi Kyle, this is an excellent addition, thanks very much! I'll do my best to read through the changes this evening and get back to you tomorrow.

conarro commented 7 years ago

@tomichj sounds good, thanks!

tomichj commented 7 years ago

Great change! I merged it to master. Thanks very much! A new gem release will be coming shortly. Thanks again!

tomichj commented 7 years ago

the more I think about this... I think the default should be case-insensitive emails. Any good reason to keep it case-sensitive?

I wonder if there's a reason to even allow case-sensitive emails?

conarro commented 7 years ago

I thought that too, but went this route for backwards compatibility. It probably makes sense​ to default to case insensitive, and potentially remove the option altogether as you suggest.

Let me know if I can help on that. A good start might be renaming the option to "insensitive" (basically​ negate it) and default to insensitive.

On Thu, Apr 27, 2017, 01:09 Justin Tomich notifications@github.com wrote:

the more I think about this... I think the default should be case-insensitive emails. Any good reason to keep it case-sensitive?

I wonder if there's a reason to even allow case-sensitive emails?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tomichj/invitation/pull/7#issuecomment-297613245, or mute the thread https://github.com/notifications/unsubscribe-auth/ABLPKi0q8kJZKruAgciT2R8O7ut8Vp8Mks5r0CLsgaJpZM4NGZ7q .

-- Kyle Conarro conarro.com http://kyle.conarro.com twitter.com/conarro github.com/conarro