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

# Render Email Template

> Render an email template without sending.

Args:
    render_request: Template rendering request with variables.

Returns:
    Rendered email content (subject, html_body, text_body).

Raises:
    HTTPException: 404 if template not found, 422 if rendering fails.



## OpenAPI

````yaml post /api/v1/admin/email/templates/render
openapi: 3.1.0
info:
  title: SnackBase
  description: Open-source Backend-as-a-Service (BaaS)
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/admin/email/templates/render:
    post:
      tags:
        - admin
        - email
        - admin
        - email
      summary: Render Email Template
      description: |-
        Render an email template without sending.

        Args:
            render_request: Template rendering request with variables.

        Returns:
            Rendered email content (subject, html_body, text_body).

        Raises:
            HTTPException: 404 if template not found, 422 if rendering fails.
      operationId: render_email_template_api_v1_admin_email_templates_render_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmailTemplateRenderRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmailTemplateRenderResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    EmailTemplateRenderRequest:
      properties:
        template_type:
          type: string
          title: Template Type
        variables:
          additionalProperties:
            type: string
          type: object
          title: Variables
        locale:
          type: string
          title: Locale
          default: en
        account_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Account Id
        subject:
          anyOf:
            - type: string
            - type: 'null'
          title: Subject
        html_body:
          anyOf:
            - type: string
            - type: 'null'
          title: Html Body
        text_body:
          anyOf:
            - type: string
            - type: 'null'
          title: Text Body
      type: object
      required:
        - template_type
        - variables
      title: EmailTemplateRenderRequest
      description: |-
        Request schema for rendering a template without sending.

        Attributes:
            template_type: Template type to render (e.g., 'email_verification').
            variables: Dictionary of variables for template rendering.
            locale: Optional language/locale code (default: 'en').
            account_id: Optional account ID for template lookup.
    EmailTemplateRenderResponse:
      properties:
        subject:
          type: string
          title: Subject
        html_body:
          type: string
          title: Html Body
        text_body:
          type: string
          title: Text Body
      type: object
      required:
        - subject
        - html_body
        - text_body
      title: EmailTemplateRenderResponse
      description: |-
        Response schema for rendered template content.

        Attributes:
            subject: Rendered subject line.
            html_body: Rendered HTML body.
            text_body: Rendered plain text body.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````