296Document Templates
E-mail and letter templates with {{placeholders}} filled from JSON data.
Try it
Template preview
Change the JSON and press Render - TemplateService fills every {{placeholder}}Invoice INV202610-00001 from Study Co., Ltd.
Dear Khun Somchai,
Please find attached invoice INV202610-00001 dated 26 Oct 2026.
Customer : SIAM RETAIL CO., LTD.
Amount : 128,450.50 THB
Due date : 25 Nov 2026 (Net 30 days)
Please transfer to Kasikornbank account 123-4-56789-0.
Thank you for your business.
Study Co., Ltd.
| # | Code | Name | Document type | Version | Status | |
|---|---|---|---|---|---|---|
| 1 | INV_EMAIL | Invoice e-mail | INV | 1 | Active | βοΈ |
| 2 | QT_COVER | Quotation cover letter | QT | 1 | Active | βοΈ |
| 3 | RC_THANKS | Receipt thank-you note | RC | 1 | Active | βοΈ |
Showing 1β3 of 3
π Learn: how this master is built table doc_template
Key points
- NVARCHAR(MAX) for long text.
- TemplateService uses a regex and Jackson (JSON β Map) to fill placeholders.
Code
- Entity
domain/DocTemplate.java- Repository
repo/DocTemplateRepository.java- Definition
MasterRegistry: "templates"- Page / form
web/MasterController.java- Try-it panel
templates/tools/template-preview.html- REST API
POST /api/templates/INV_EMAIL/render (body: JSON data)
SQL to try in SSMS (database MasterDataLabDB)
SELECT code, subject, LEN(body) AS body_length FROM doc_template;