Repository navigation
Checking receipt content and required variants after email rendering (runnable example) #3780
awslew
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I'm building InlinerAPI and put together a small, runnable example for checking the business content of rendered receipt emails.
For teams using React Email, this sits after rendering: the checker accepts HTML you already produced. It doesn't render React components or test email-client layout.
The synthetic case
The fixture has three required variants: USD, EUR and discounted USD. One deliberately broken variant displays €29.00 while the independent EUR expectation is €24.00. All three HTML documents can parse successfully, so parsing alone doesn't catch that mistake.
The checks cover:
/orders/path.The amounts are independent test fixtures, not currency conversions. Deriving both the HTML and the expected value from the same buggy calculation would weaken the check.
Run it
The code and self-contained synthetic inputs are here:
https://gist.github.com/awslew/7ec0dd389e925f60624a3f19299871d9
Download
receipt-check.cjsanddemo-run.cjsinto an empty directory, then:Verified with Node v24.16.0. Output:
The runner prints results; it isn't a CI gate. In a test suite, assert that the failure array is empty, or make your own CI command exit nonzero on failures.
Web example and feedback
I also have a free, no-signup synthetic example:
https://inlinerapi.netlify.app/requirements?utm_source=react_email_discussion&utm_medium=community&utm_campaign=receipt_contract_20261008
Choose Order receipt → Load broken example → Preview requirements, then try the passing example. The single EUR preview was checked on the live site on October 7: the broken case was Blocked · 4/5 passed, and the passing case was Passed · 5/5 passed. That single preview does not establish coverage of the full matrix.
This is static source checking: it doesn't establish visibility, Gmail/Outlook rendering, delivery, live billing correctness, link availability or backend authorization.
For your most recent template change, did you already check rendered content and required data variants automatically, or did that review still happen manually? A brief description of the actual workflow would be useful; no customer template or private data is needed.
Disclosure: this is my product and my example. AI assisted the draft; I reviewed the claims and executed the broken, fixed and missing-variant cases.
All reactions