Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -621,17 +621,17 @@ Send a transactional email to a contact. [Learn about sending transactional emai

#### Parameters

| Name | Type | Required | Notes |
| --------------------------- | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `transactionalId` | string | Yes | The ID of the transactional email to send. |
| `email` | string | Yes | The email address of the recipient. |
| `addToAudience` | boolean | No | If `true`, a contact will be created in your audience using the `email` value (if a matching contact doesn’t already exist). |
| `dataVariables` | object | No | An object containing data as defined by the data variables added to the transactional email template.<br />Values can be of type `string` or `number`. |
| `attachments` | object[] | No | A list of attachments objects.<br />**Please note**: Attachments need to be enabled on your account before using them with the API. [Read more](https://loops.so/docs/transactional/attachments) |
| `attachments[].filename` | string | No | The name of the file, shown in email clients. |
| `attachments[].contentType` | string | No | The MIME type of the file. |
| `attachments[].data` | string | No | The base64-encoded content of the file. |
| `headers` | object | No | Additional headers to send with the request. |
| Name | Type | Required | Notes |
| --------------------------- | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `transactionalId` | string | Yes | The ID of the transactional email to send. |
| `email` | string | Yes | The email address of the recipient. |
| `addToAudience` | boolean | No | If `true`, a contact will be created in your audience using the `email` value (if a matching contact doesn’t already exist). |
| `dataVariables` | object | No | An object containing data as defined by the data variables added to the transactional email template.<br />Values can be of type `string`, `number`, or an array of objects with `string` or `number` values. |
| `attachments` | object[] | No | A list of attachments objects.<br />**Please note**: Attachments need to be enabled on your account before using them with the API. [Read more](https://loops.so/docs/transactional/attachments) |
| `attachments[].filename` | string | No | The name of the file, shown in email clients. |
| `attachments[].contentType` | string | No | The MIME type of the file. |
| `attachments[].data` | string | No | The base64-encoded content of the file. |
| `headers` | object | No | Additional headers to send with the request. |

#### Examples

Expand Down Expand Up @@ -770,7 +770,8 @@ const resp = await loops.getTransactionalEmails({ perPage: 15 });

## Version history

- `v6.1.0` (Jan 29, 2026) - Added `rawBody` to `APIError` in the case no JSON is received from the server (thanks to [@leipert](https://github.com/leipert)).
- `v6.2.0` (Feb 9, 2026) - Support for the new arrays feature in sendTransactionalEmail.
- `v6.1.2` (Jan 29, 2026) - Added `rawBody` to `APIError` in the case no JSON is received from the server (thanks to [@leipert](https://github.com/leipert)).
- `v6.0.1` (Oct 15, 2025) - Added `optInStatus` to contact object in [`findContact()`](#findcontact) for the new double opt-in feature.
- `v6.0.0` (Aug 22, 2025) - [`createContact()`](#createcontact) and [`updateContact()`](#updatecontact) now have a single object parameter instead of named parameters (breaking change). This allows support for using either `email` or `userId` when updating contacts.
- `v5.0.1` (May 13, 2025) - Added a `headers` parameter for [`sendEvent()`](#sendevent) and [`sendTransactionalEmail()`](#sendtransactionalemail), enabling support for the `Idempotency-Key` header.
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "loops",
"version": "6.1.2",
"version": "6.2.0",
"author": "Dan Rowden <dan@loops.so>",
"license": "MIT",
"main": "./dist/index.cjs",
Expand Down
5 changes: 4 additions & 1 deletion src/__tests__/LoopsClient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,10 @@ describe("LoopsClient", () => {
email: "test@example.com",
dataVariables: {
name: "John",
product: "Widgets",
products: [
{ name: "Widget", price: 29.99 },
{ name: "Gadget", price: 49.99 },
],
},
};
const mockResponse = { success: true };
Expand Down
5 changes: 4 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ type EventProperties = Record<string, string | number | boolean>;

type MailingLists = Record<string, boolean>;

type TransactionalVariables = Record<string, string | number>;
type TransactionalVariables = Record<
string,
string | number | Array<Record<string, string | number>>
>;

interface TransactionalAttachment {
/**
Expand Down