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

# Render an email preview

> Render an email the way a recipient gets it, from unsaved editor values: `emailStyle`
(plain, personal or company), `subject`, `preheader`, `message` (TipTap JSON, or
`{ localized: { <lang>: doc } }`), optional `sender` (a teammate id, or
`{ customSenderName }`), `lang` and `brand` (unsaved `emailBrand` values). The current
user is the sample recipient and variables resolve with their values. Nothing is
stored or sent.



## OpenAPI

````yaml https://api.gleap.io/api-docs.json post /engagement/emails/render-preview
openapi: 3.0.0
info:
  title: gleap-server
  version: 14.0.0
  contact: {}
servers:
  - url: https://api.gleap.io/v3
security: []
paths:
  /engagement/emails/render-preview:
    post:
      tags:
        - Engagement Email
      summary: Render an email preview
      description: >-
        Render an email the way a recipient gets it, from unsaved editor values:
        `emailStyle`

        (plain, personal or company), `subject`, `preheader`, `message` (TipTap
        JSON, or

        `{ localized: { <lang>: doc } }`), optional `sender` (a teammate id, or

        `{ customSenderName }`), `lang` and `brand` (unsaved `emailBrand`
        values). The current

        user is the sample recipient and variables resolve with their values.
        Nothing is

        stored or sent.
      operationId: RenderEmailPreview
      parameters:
        - in: header
          name: project
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RenderPreviewBody'
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                properties:
                  sizeBytes:
                    type: number
                    format: double
                  text:
                    type: string
                  html:
                    type: string
                required:
                  - sizeBytes
                  - text
                  - html
                type: object
      security:
        - jwt: []
components:
  schemas:
    RenderPreviewBody:
      properties:
        emailStyle:
          type: string
        subject: {}
        preheader: {}
        message:
          description: 'TipTap document, or `{ localized: { <lang>: document } }`.'
        sender:
          anyOf:
            - type: string
            - properties:
                customSenderName:
                  type: string
                id:
                  type: string
              type: object
          description: >-
            A teammate id, or `{ id?, customSenderName? }`. Defaults to the
            current user.
        lang:
          type: string
        brand:
          description: Unsaved `emailBrand` values from the brand settings page.
        emailCategory:
          type: string
          enum:
            - conversational
            - marketing
          description: >-
            Conversational emails show no unsubscribe line. Defaults to
            marketing (a newsletter).
      required:
        - emailStyle
      type: object
      additionalProperties: false
  securitySchemes:
    jwt:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.