Draft Letter
draft_letterCreate a letter DRAFT: verifies the recipient address with PostGrid, screens content, and returns a price quote. This NEVER mails anything.
Pass EITHER html (letter body as an HTML string) OR pdf_path (path to a PDF file on the server). PDF text is extracted for screening; if extraction fails the draft is kept but flagged needs_review.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | recipient address dict with name, address_line1, address_city, address_state, address_zip (US). | |
| html | No | letter body as an HTML string (use this OR pdf_path). | |
| color | No | True for color printing, False for black & white. | |
| api_key | Yes | your 3L-Group Technology API key (lms_...). | |
| pdf_path | No | server-local path to a PDF to mail instead of html. | |
| quantity | No | number of identical letters (10+ gets the bulk rate). | |
| certified | No | OPT-IN ONLY — True for USPS Certified Mail with Electronic Receipt (tracked, signature on delivery). Defaults to False, which sends standard First Class mail. Only set True when the customer explicitly asked for certified mail: it costs significantly more (PostGrid's certified rate + the flat $1.00 service fee, roughly $11 per letter). Never default this to True. | |
| description | No | optional label for your own records. | |
| from_address | Yes | sender address dict, same shape as `to`. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||