Email check @notaires.fr
This commit is contained in:
parent
2b75db2a4a
commit
a61e2e07d4
@ -44,6 +44,12 @@ export default class Newsletter extends React.Component<IProps, IState> {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const notairesRegex = /^[^\s@]+@notaires\.fr$/;
|
||||||
|
if (!notairesRegex.test(this.state.email)) {
|
||||||
|
this.setState({ errorMessage: "L'adresse email que vous avez saisie doit terminer par @notaires.fr.", successMessage: "" });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Mailchimp.getInstance().post({ email: this.state.email });
|
Mailchimp.getInstance().post({ email: this.state.email });
|
||||||
// Clear error message
|
// Clear error message
|
||||||
this.setState({ errorMessage: "" });
|
this.setState({ errorMessage: "" });
|
||||||
|
Loading…
x
Reference in New Issue
Block a user