Send from a template
send_from_templateCreate a document from a template and e-mail recipients for e-signature, or save it as a draft for review. Confirm people and values first; retry safely with an idempotency key.
Instructions
Creates a document from a template: one person per role, values for its data keys. With send=true PenlyDoc immediately e-mails the people with delivery EMAIL; confirm the people and values with the user first. With send=false it creates a draft the user can review in the console. Use the same externalRef/idempotencyKey to safely retry.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | Values for the template data keys, e.g. {"Rent": "950 EUR"} | |
| send | Yes | true = e-mail people now; false = draft | |
| roles | Yes | Keyed by role key from list_templates, e.g. {"tenant": {"name": "Mia Novak", "email": "mia@example.com"}} | |
| title | No | ||
| message | No | ||
| templateId | Yes | ||
| externalRef | No | Your own reference, e.g. an order or contract number | |
| idempotencyKey | No |