> Markdown versions of all pages of this connector library are available by appending `.md` to the page URL. For the full index of connectors, see [llms.txt](https://connectors.appmixer.com/llms.txt).

# Send Transactional Email

- Component: `appmixer.loops.core.SendTransactionalEmail`
- Kind: Action
- Version: 1.0.0
- Visibility: Public
- Connector: [appmixer.loops 1.0.0](https://connectors.appmixer.com/connector/appmixer.loops/1.0.0.md)
- Component page: <https://connectors.appmixer.com/connector/appmixer.loops/1.0.0/component/appmixer.loops.core.SendTransactionalEmail>

Send a published transactional email to one recipient, with optional data variables.

## Input ports

### Port `in`

| Field | Type | Description |
| --- | --- | --- |
| Transactional Email (`transactionalId`) | text | Pick a transactional email, or type its ID. The email must be published in Loops. |
| Email (`email`) | text | The recipient's email address. |
| Add To Audience (`addToAudience`) | toggle | Create a contact in your audience with this email address if it does not exist yet. |
| Data Variables (`dataVariables`) | textarea | Optional JSON object with the data variables of the transactional email, for example `{"name": "Alex", "resetLink": "https://example.com/reset"}`. Values can be strings or numbers; array variables take an array of objects. |
| Idempotency Key (`idempotencyKey`) | text | Optional unique ID for this request (up to 100 characters). Loops rejects a repeated key within 24 hours, which prevents duplicate emails. |

## Output ports

### Port `out`

| Field | Type | Description |
| --- | --- | --- |
| Success (`success`) | boolean | - |
| Transactional Email ID (`transactionalId`) | string | - |
| Email (`email`) | string | - |

## Full metadata (component.json)

```json
{
  "name": "appmixer.loops.core.SendTransactionalEmail",
  "label": "Send Transactional Email",
  "description": "Send a published transactional email to one recipient, with optional data variables.",
  "author": "Appmixer <info@appmixer.com>",
  "version": "1.0.0",
  "auth": {
    "service": "appmixer:loops"
  },
  "quota": {
    "manager": "appmixer:loops",
    "resources": "requests",
    "scope": {
      "userId": "{{userId}}"
    }
  },
  "inPorts": [
    {
      "name": "in",
      "schema": {
        "type": "object",
        "properties": {
          "transactionalId": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "addToAudience": {
            "type": "boolean"
          },
          "dataVariables": {
            "type": "string"
          },
          "idempotencyKey": {
            "type": "string"
          }
        },
        "required": [
          "transactionalId",
          "email"
        ]
      },
      "inspector": {
        "inputs": {
          "transactionalId": {
            "type": "text",
            "index": 1,
            "label": "Transactional Email",
            "tooltip": "Pick a transactional email, or type its ID. The email must be published in Loops.",
            "source": {
              "url": "/component/appmixer/loops/core/ListTransactionalEmails?outPort=out",
              "data": {
                "messages": {
                  "in/outputType": "array"
                },
                "properties": {
                  "isSource": true
                },
                "transform": "./ListTransactionalEmails#toSelectArray"
              }
            }
          },
          "email": {
            "type": "text",
            "index": 2,
            "label": "Email",
            "tooltip": "The recipient's email address."
          },
          "addToAudience": {
            "type": "toggle",
            "index": 3,
            "label": "Add To Audience",
            "defaultValue": false,
            "tooltip": "Create a contact in your audience with this email address if it does not exist yet."
          },
          "dataVariables": {
            "type": "textarea",
            "index": 4,
            "label": "Data Variables",
            "tooltip": "Optional JSON object with the data variables of the transactional email, for example <code>{\"name\": \"Alex\", \"resetLink\": \"https://example.com/reset\"}</code>. Values can be strings or numbers; array variables take an array of objects."
          },
          "idempotencyKey": {
            "type": "text",
            "index": 5,
            "label": "Idempotency Key",
            "tooltip": "Optional unique ID for this request (up to 100 characters). Loops rejects a repeated key within 24 hours, which prevents duplicate emails."
          }
        }
      }
    }
  ],
  "outPorts": [
    {
      "name": "out",
      "schema": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success",
            "example": true
          },
          "transactionalId": {
            "type": "string",
            "title": "Transactional Email ID",
            "example": "cll42l54f20i1la0lfooe3z12"
          },
          "email": {
            "type": "string",
            "title": "Email",
            "example": "alex@company.com"
          }
        }
      }
    }
  ],
  "icon": "(data URI omitted)"
}
```
