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

Feature request: some sort of email normalization? #50

Closed
psimonazzi opened this issue Jan 18, 2022 · 3 comments · Fixed by #51
Closed

Feature request: some sort of email normalization? #50

psimonazzi opened this issue Jan 18, 2022 · 3 comments · Fixed by #51
Assignees
Labels
enhancement New feature or request

Comments

@psimonazzi
Copy link

Given the quite loose definition of the email standard forms, it could be useful to provide some sort of normalization of the Email object, to render it in a way that most people commonly recognize as a plain and bare email address.
That would be equivalent to stripping comments, optional parts, etc.:
email.localPartWithoutComments() + "@" + email.domainWithoutComments().
This feature could be useful for example when we not only want to validate the address as a mail recipient, but use it as some sort of identifier (for example in login systems).

@psimonazzi psimonazzi added the bug Something isn't working label Jan 18, 2022
@RohanNagar
Copy link
Owner

RohanNagar commented Jan 18, 2022

Hi @psimonazzi, thank you for your comment. Am I correct in my understanding that you are asking for a new convenience method on the Email object that returns the email address with solely the local-part and the domain, without any comments or identifiers?

That should be straightforward to add as it would be the same as doing email.localPartWithoutComments() + "@" + email.domainWithoutComments(), but I want to make sure that is what you are asking for.

Please see #51 and let me know if that addresses your ask.

@RohanNagar RohanNagar added enhancement New feature or request question Question regarding functionality or usage and removed bug Something isn't working labels Jan 18, 2022
@psimonazzi
Copy link
Author

Hi, yes, I think that would do, thanks.

@RohanNagar
Copy link
Owner

Thanks! I have merged the improvement and released version v1.4.0 which contains the new method.

@RohanNagar RohanNagar removed the question Question regarding functionality or usage label Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants