Repository navigation
Checking invitation role and conditional sections after rendering (free demo) #3142
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.
A member invitation should not show the admin section
I’m building InlinerAPI, a tool for checking the business content of rendered emails. Here is a free synthetic invitation example that checks both a role label and a conditional section.
For an MJML pipeline, the useful boundary is the final HTML after MJML and any data templating have run. This demo uses small, plain HTML fixtures and inspects their source. Keep MJML validation and email-client rendering tests alongside these content assertions.
A role label is only part of an invitation email's contract. A member fixture can say "Member" correctly while an admin-only section still appears. Test the label and the conditional section separately.
Consider three synthetic branches:
memberadminreminderGive the rendered label and section stable IDs:
Then use independent requirements for the member case:
[ { "id": "member-role", "selector": "#role", "match": "equals", "value": "Member", "scenarios": ["member"] }, { "id": "no-admin-section", "selector": "#admin-section", "match": "absent", "scenarios": ["member", "reminder"] } ]The admin branch needs its own positive section-presence requirement. An absence test across every branch would hide the intended admin content. Keep the required branch list intact, so dropping the member fixture cannot erase the failed case.
In the synthetic InlinerAPI example, the broken member HTML contains "Admin" and an admin section. The live single-member preview returned Blocked, 4/6 passed, failing
member-roleandno-admin-section. The corrected member preview returned Passed, 6/6 passed. These two member results were verified on the public site. The corrected member, admin and reminder fixtures each passed 6/6 in the earlier local evaluator run; the single-member live result does not establish all matrix variants passed.This checks content in rendered HTML. It does not prove that your application granted the correct role, that an invitation token is valid or that the recipient can access only permitted resources. Those require application tests. CSS-hidden markup is still markup, so test presence deliberately and keep visual checks separately.
To try the existing public example, no account or API key is needed:
Use synthetic data only. The public matrix can inspect all named branches together.
For your most recent invitation-template change, were role-specific sections checked automatically after rendering, or did that review happen manually?
Disclosure: I work on InlinerAPI. This is our free public beta. AI assisted this explanation; the stated local evaluator results and live member previews were executed with synthetic fixtures. No customer incidents or savings are claimed.
All reactions