Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow requiring display names as part of email, optionally #607

Merged
merged 3 commits into from
Nov 28, 2016

Conversation

icenine457
Copy link
Contributor

I'm using this (fantastic) library to help ensure that e-mails for a mail merge function in our system work as expected. As part of working to mitigate the spam score possibility, I'm forcing our users to include a display name as part of the e-mail that they're using. This pull request adds an option to force an e-mail to include the display name (piggybacking off of the existing "allow_display_name" option).

@coveralls
Copy link

Coverage Status

Coverage increased (+0.004%) to 98.842% when pulling 051ebd2 on icenine457:master into 4726231 on chriso:master.

if (options.require_display_name) {
options.allow_display_name = true;
}

if (options.allow_display_name) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd use if (options.allow_display_name || options.require_display_name) here instead of setting the flag above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to make that change. I wasn't sure if the option was in use elsewhere, and wanted to avoid the case where someone had explicitly erroneously set allow_display_name to false, while setting require_display_name to true. Looking at the code, that doesn't seem to be a concern.

@@ -24,6 +25,7 @@ var alpha = exports.alpha = {
var alphanumeric = exports.alphanumeric = {
'en-US': /^[0-9A-Z]+$/i,
'cs-CZ': /^[0-9A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,
'da-DK': /^[0-9A-ZÆØÅ]$/i,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add this locale to the README?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was related to #601 by @LayZeeDK. I've added it to the README as an additional commit.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah thanks, I must have missed it then.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.004%) to 98.842% when pulling b6ec14f on icenine457:master into 4726231 on chriso:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.004%) to 98.842% when pulling 4d05442 on icenine457:master into 4726231 on chriso:master.

@chriso chriso merged commit 19bd81b into validatorjs:master Nov 28, 2016
@chriso
Copy link
Collaborator

chriso commented Nov 28, 2016

Thanks for the PR 😄

chriso added a commit that referenced this pull request Nov 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants