> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vellaro.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Preview Template

> Render a draft (subject/body from the editor, possibly unsaved) with
sample data for `key`, in the tenant's own brand context. Full render, so
it catches undefined variables and bad filters — mapped to a 422.



## OpenAPI

````yaml https://api.vellaro.io/openapi.json post /api/v1/admin/email-templates/{key}/preview
openapi: 3.1.0
info:
  title: Vellaro API
  description: Vellaro 2026 — E-commerce API
  version: 0.1.0
servers:
  - url: https://api.vellaro.io
    description: Produzione
security: []
tags: []
paths:
  /api/v1/admin/email-templates/{key}/preview:
    post:
      tags:
        - admin:email-templates
      summary: Preview Template
      description: >-
        Render a draft (subject/body from the editor, possibly unsaved) with

        sample data for `key`, in the tenant's own brand context. Full render,
        so

        it catches undefined variables and bad filters — mapped to a 422.
      operationId: preview_template_api_v1_admin_email_templates__key__preview_post
      parameters:
        - name: key
          in: path
          required: true
          schema:
            type: string
            title: Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PreviewIn'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_PreviewOut_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    PreviewIn:
      properties:
        locale:
          type: string
          maxLength: 5
          minLength: 2
          title: Locale
        subject:
          type: string
          title: Subject
        body_html:
          type: string
          title: Body Html
        body_text:
          anyOf:
            - type: string
            - type: 'null'
          title: Body Text
      type: object
      required:
        - locale
        - subject
        - body_html
      title: PreviewIn
    ApiResponse_PreviewOut_:
      properties:
        data:
          anyOf:
            - $ref: '#/components/schemas/PreviewOut'
            - type: 'null'
        meta:
          anyOf:
            - $ref: '#/components/schemas/PaginationMeta'
            - type: 'null'
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
      type: object
      title: ApiResponse[PreviewOut]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PreviewOut:
      properties:
        subject:
          type: string
          title: Subject
        html:
          type: string
          title: Html
        text:
          type: string
          title: Text
        locale:
          type: string
          title: Locale
      type: object
      required:
        - subject
        - html
        - text
        - locale
      title: PreviewOut
    PaginationMeta:
      properties:
        page:
          type: integer
          title: Page
        page_size:
          type: integer
          title: Page Size
        total:
          type: integer
          title: Total
        total_pages:
          type: integer
          title: Total Pages
      type: object
      required:
        - page
        - page_size
        - total
        - total_pages
      title: PaginationMeta
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````