Skip to content

fix(customer): Fix email validation and add tests #3847

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

Merged
merged 1 commit into from
Jun 25, 2025
Merged

fix(customer): Fix email validation and add tests #3847

merged 1 commit into from
Jun 25, 2025

Conversation

groyoh
Copy link
Contributor

@groyoh groyoh commented Jun 18, 2025

Context

Our current email validation regex is too permissive, allowing invalid emails like test email@domain.com. This caused some invoice email send-out failures.

Description

The main issue comes from the fact that our regex does not have \A and \z anchors, which means it can match parts of a string rather than the whole string. The validator also accepted a trailing ,.

To ensure no breaking change on potential invalid emails, the validation now only runs if customer's email was changed.

@groyoh groyoh changed the title fix(email): Fix email validation regex and add tests fix(customer): Fix email validation regex and add tests Jun 18, 2025
@groyoh groyoh changed the title fix(customer): Fix email validation regex and add tests fix(customer): Fix email validation and add tests Jun 18, 2025
@groyoh groyoh changed the base branch from main to fix-customer-email June 19, 2025 07:29
Base automatically changed from fix-customer-email to main June 25, 2025 13:58
Our current email validation regex is too permissive, allowing invalid emails like `test email@domain.com`. This caused some invoice emails sendout failures.

The main issue comes from the fact that our regex does not have `\A` and `\z` anchors, which means it can match parts of a string rather than the whole string.
@groyoh groyoh merged commit 6e90c80 into main Jun 25, 2025
14 checks passed
@groyoh groyoh deleted the fix/email branch June 25, 2025 14:21
@ivannovosad ivannovosad added Contribution Contributions from the Lago Community and removed Contribution Contributions from the Lago Community labels Jun 25, 2025
diegocharles pushed a commit that referenced this pull request Jun 30, 2025
## Context

Our current email validation regex is too permissive, allowing invalid emails like `test email@domain.com`. This caused some invoice email send-out failures.

## Description

The main issue comes from the fact that our regex does not have `\A` and `\z` anchors, which means it can match parts of a string rather than the whole string. The validator also accepted a trailing `,`.

To ensure no breaking change on potential invalid emails, the validation now only runs if customer's email was changed.
diegocharles pushed a commit that referenced this pull request Jul 11, 2025
## Context

Our current email validation regex is too permissive, allowing invalid emails like `test email@domain.com`. This caused some invoice email send-out failures.

## Description

The main issue comes from the fact that our regex does not have `\A` and `\z` anchors, which means it can match parts of a string rather than the whole string. The validator also accepted a trailing `,`.

To ensure no breaking change on potential invalid emails, the validation now only runs if customer's email was changed.
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.

2 participants