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

# Send an email based off an email template



## OpenAPI

````yaml /openapi.json post /email_templates/{id}/send
openapi: 3.0.3
info:
  title: Pocketflows API
  version: 0.0.4
servers:
  - url: https://api.pocketflows.com
    description: Production server
security:
  - HttpBasicAuth: []
paths:
  /email_templates/{id}/send:
    post:
      tags:
        - Emails
      summary: Send an email based off an email template
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: The ID of the email template
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              anyOf:
                - type: object
                  properties:
                    from:
                      type: string
                      description: The ID of the email address from which to send the email
                    attachments:
                      type: array
                      items:
                        type: object
                        properties:
                          content:
                            type: string
                            description: >-
                              The content of the attachment as a data url, e.g.
                              'data:image/png;base64,abcd1234'
                          name:
                            type: string
                            description: The intended name of the attachment
                        required:
                          - content
                          - name
                      description: An array of attachments to include with the email
                    to:
                      type: string
                      description: The email address to send the email to
                    variables:
                      type: object
                      additionalProperties: true
                      description: The variables to be injected into the email template
                  required:
                    - from
                    - to
                - type: object
                  properties:
                    from:
                      type: string
                      description: The ID of the email address from which to send the email
                    attachments:
                      type: array
                      items:
                        type: object
                        properties:
                          content:
                            type: string
                            description: >-
                              The content of the attachment as a data url, e.g.
                              'data:image/png;base64,abcd1234'
                          name:
                            type: string
                            description: The intended name of the attachment
                        required:
                          - content
                          - name
                      description: An array of attachments to include with the email
                    customer:
                      type: string
                      description: The ID of the customer to send the email to
                    variables:
                      type: object
                      additionalProperties: true
                      description: >-
                        The variables to be injected into the email template in
                        addition to the variables already induced by the
                        customer
                  required:
                    - from
                    - customer
      responses:
        '200':
          description: The sent `SentEmail` object
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: The ID of the campaign
                  created_at:
                    type: string
                    description: The time when the campaign was created in ISO 8601 format
                  customer:
                    type: string
                    nullable: true
                    description: The ID of the customer that was sent the email
                  subject:
                    type: string
                    description: The subject of the email
                  sent_at:
                    type: string
                    nullable: true
                    description: The time when the email was sent in ISO 8601 format
                  failed_at:
                    type: string
                    nullable: true
                    description: The time when the email failed to send in ISO 8601 format
                  failed_reason:
                    type: string
                    nullable: true
                    description: The reason the email failed to send
                  to_email_address:
                    type: string
                    nullable: true
                    description: The email address the email was sent to
                  sendgrid_message_id:
                    type: string
                    nullable: true
                    description: Sendgrid's returned message ID
                  paubox_message_id:
                    type: string
                    nullable: true
                    description: Paubox's returned message ID
                  postmark_message_id:
                    type: string
                    nullable: true
                    description: Postmark's returned message ID
                  ok:
                    type: boolean
                    description: Whether the email was sent successfully
                required:
                  - id
                  - created_at
                  - customer
                  - subject
                  - sent_at
                  - failed_at
                  - failed_reason
                  - to_email_address
                  - ok
components:
  securitySchemes:
    HttpBasicAuth:
      type: http
      scheme: basic

````