Skip to content

Commit

Permalink
feat: support contact email list
Browse files Browse the repository at this point in the history
Closes #4390

Users requested to setup multiple emails in our default form action.
  • Loading branch information
TrySound committed Nov 8, 2024
1 parent 8427428 commit 3aadcba
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,12 @@ export const SectionGeneral = () => {
);
const siteNameId = useId();
const contactEmailId = useId();
const contactEmail = (meta.contactEmail ?? "").trim();
const contactEmailError =
(meta.contactEmail ?? "").trim().length === 0 ||
Email.safeParse(meta.contactEmail).success
contactEmail.length === 0 ||
contactEmail
.split(",")
.every((email) => Email.safeParse(email.trim()).success)
? undefined
: "Contact email is invalid.";
const assets = useStore($assets);
Expand Down

0 comments on commit 3aadcba

Please sign in to comment.