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

add asMailString() #146

Closed
RodrigoDornelles opened this issue Aug 18, 2021 · 4 comments
Closed

add asMailString() #146

RodrigoDornelles opened this issue Aug 18, 2021 · 4 comments

Comments

@RodrigoDornelles
Copy link

Is your feature request related to a problem? Please describe.
is something interesting, there is an email validation when string, I would liken [...]

Describe the solution you'd like
do a regex validation over email, someone can refine it in the future and check IDN and DNS

Additional context

const email = env.get('MAIL_USER').asMailString();
@evanshortiss
Copy link
Owner

evanshortiss commented Aug 20, 2021

@RodrigoDornelles this is a good suggestion. I've had to do this before, though I was lazy and used asString().

The one issue with this is how strict the implementation is. There are a few good suggestions in this StackOverflow post and this one too.

Personally I would accept a PR that does a simple regex, then mention this in the module docs. Aiming for full RFC compliance is not necessary since it would require using a third party module like this one or potentially complex code.

Do you want to open a PR?

@RodrigoDornelles
Copy link
Author

i think so, i'm not very familiar with regex and am typescript's noob, but i'll try anyway... carefully review my PR!

@bigen1925
Copy link
Contributor

Hi guys,

Thank you for providing this simple and awesome library, I love this. :D

And I will be also happy if this feature will be implemented, but there seems to be no progress in months, so I opened a PR.

#158

I'm happy to be reviewed.

@evanshortiss
Copy link
Owner

Released this in version 7.2.0. Thank you all.

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

No branches or pull requests

3 participants