Testing4 min read•Audience: All, Developers
Sample Data Management
Define, manage, and switch mock JSON datasets to test email templates with realistic data before exporting.
Key Takeaways
- Each PostBrix project maintains an integrated Sample Data JSON document.
- Create realistic test cases: single item vs 10 items, long customer names, missing optional fields.
- Switch between test scenarios in the preview modal to verify layout resilience.
Configuring Sample JSON in the Editor#
To provide sample data for your templates:
- Click the Data / Variables tab in the top navigation bar.
- An interactive JSON code editor opens.
- Paste or write your mock data payload:
code
json
As you edit the JSON, your visual canvas immediately reflects the live interpolated values.
Essential Edge Cases to Test#
Before exporting your template, test with extreme values in your sample JSON:
- Long Text Strings: Set
firstNameto a 35-character compound name to check for button and title wrapping. - Empty Arrays: Set
items: []to verify your empty-state fallback UI. - Null Fields: Set optional address fields to
nullto verify that{{fallback}}helpers activate properly.
Frequently Asked Questions
Is sample data included when I export HTML for my ESP?
When exporting Dynamic HTML, your sample data is excluded and raw Handlebars tags are preserved. If you export Static HTML, the sample data is baked directly into the markup.
Can I save multiple sample data presets for a single template?
Yes. You can save multiple scenario payloads (e.g., "VIP Customer", "First-time Buyer", "Empty Cart") in the Data panel to switch between them quickly.