Repository navigation
Corpus enquiry form on @profullstack/contact-form 0.2.0 - #258
Merged
Merged
Conversation
/sales and /api/sales/contact now share one createContactForm object
(apps/web/src/lib/salesContact.js) and keep their questions: name, email
(required), company or project, and the use case (required, at least ten
characters, same wording), the intro line and the hint under the box.
What stays the same: the enquiry is stored in dataset_enquiries before any
mail goes out and a failed mail never fails the request; the three per
hour per address limit is still read from the database; the notification
goes to SALES_EMAIL (default hello@rssamplifier.com) through
@rssamplifier/mail with Reply-To the sender and the same subject; a plain
form post (JavaScript off) still gets a 303 back to /sales#enquire; JSON
callers may still send useCase.
What is new: the form carries form-guard's proof-of-render token, so a
POST that never loaded the page is answered like success and not stored;
with JavaScript on it answers in place. JSON errors are now
{ ok: false, error: <message> } instead of an error code. A plain form
post's ?error= carries the message, and the page shows it only if it is
one the form can produce.
Version 0.2.1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves the corpus enquiry form (
/sales,POST /api/sales/contact) onto@profullstack/contact-form@0.2.0(pinned), keeping its questions.apps/web/src/lib/salesContact.js: onecreateContactForm, built by a factory so tests can inject the store and transport. Same fields and limits (name 120, email 200 required, org 160, use case 10-4000 required with the old message), intro line as asection, the hint ashelp.dataset_enquiriesfirst (persist), mail best-effort (onSendError: 'ignore') through@rssamplifier/mailtoSALES_EMAIL, subjectCorpus enquiry: {org || email}, the DB-backed 3/hour/address limit (verify), 303 back to/sales#enquirefor no-JS posts,useCaseaccepted from JSON callers (mapBody).rssamplifier:sales, secretRESEND_API_KEYas set in prod); tokenless posts answered{ ok: true }and neither stored nor mailed. JSON errors are{ ok: false, error: message }.?error=text is shown only when it is a message the form can produce.cf-*styled inglobals.cssso the box looks as before; honeypot hidden.test/sales-contact.test.js(7 tests): tokenless not stored/sent, valid stored then mailed,useCasealias, short use case refused, DB limit, no-JS redirect.Local run: 512 pass; the 6 failures are
webhooks.test.jsneeding the CI Postgres. Build passes.🤖 Generated with Claude Code