-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Conversation
if (options.require_display_name) { | ||
options.allow_display_name = true; | ||
} | ||
|
||
if (options.allow_display_name) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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.
Thanks for the PR 😄 |
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).