# Marigold Engage by Sailthru

> Manage users, lists, campaigns and content in Marigold Engage by Sailthru, send triggered email, record purchases and custom events, and follow campaigns, lists, templates and content.

App · 25 actions. Web page: https://docs.lodol.com/docs/integrations/sailthru

## Actions

### Cancel scheduled send

Cancel a triggered email scheduled for later. One already sent can't be cancelled.

**Inputs**

- Send ID (`send_id`, text, required): The send's ID, which Send triggered email returns.

**Outputs**

- `data` (object): The response from Marigold Engage by Sailthru.

**Example output**

```json
{
  "data": {
    "ok": true,
    "send_id": "example"
  }
}
```

### Create campaign

Create a campaign from a template or your own content. With a send time it is scheduled; without one it is saved as a draft.

**Inputs**

- Name (`name`, text, required): The campaign's name.
- List (`list`, text, required): The list to send to, by name.
- Template (`template`, text): A template to copy the subject, sender and content from. Fields filled in below replace the template's.
- Subject (`subject`, text): The subject line.
- From name (`from_name`, text): The sender's name.
- From email (`from_email`, text): The sender's address, one of the account's verified From addresses.
- Reply to (`reply_to`, text): The Reply-To address.
- HTML content (`content_html`, text): The HTML content.
- Text content (`content_text`, text): The plain text content.
- Track links (`link_tracking`, true/false): Rewrite links so clicks are tracked.
- Send at (`schedule_time`, date and time): When to send. Leave empty to save a draft.

**Outputs**

- `data` (object): The response from Marigold Engage by Sailthru.

**Example output**

```json
{
  "data": {
    "blast_id": 1,
    "email_count": 1,
    "from_email": "example",
    "from_name": "example",
    "labels": [
      "example"
    ],
    "list": "example",
    "modify_time": "example",
    "name": "example",
    "schedule_time": "example",
    "start_time": "example",
    "status": "example",
    "subject": "example"
  }
}
```

### Create or update content

Add a product or article to the content library, or update the one with this URL. Fields left empty keep their value.

**Inputs**

- URL (`url`, text, required): The content item's URL, its identifier in the content library.
- Title (`title`, text): The title.
- Description (`description`, text): A short description.
- Tags (`tags`, list): Tags, such as blue or size-m, each up to 32 characters.
- Price (`price`, number): The price, such as 172.99. Sailthru stores it in cents. At least 0.
- Sale price (`sale_price`, number): The sale price, such as 145.99. At least 0.
- Inventory (`inventory`, number): How many are in stock. At least 0.
- Image URL (`image_url`, text): The URL of the item's main image.
- SKU (`sku`, text): The item's SKU, a second way to find it.
- Author (`author`, text): The author.
- Site name (`site_name`, text): The site or brand it belongs to.
- Published (`date`, date and time): When it was published. Leave empty for now.
- Expires (`expire_date`, date and time): When it stops being recommended.
- Custom fields (vars) (`vars`, object): Custom fields to set, by name, such as first_name.

**Outputs**

- `data` (object): The response from Marigold Engage by Sailthru.

**Example output**

```json
{
  "data": {
    "author": "example",
    "date": "example",
    "description": "example",
    "expire_date": "example",
    "images": {},
    "inventory": 1,
    "price": 1,
    "site_name": "example",
    "tags": [
      "example"
    ],
    "title": "example",
    "url": "example",
    "vars": {}
  }
}
```

### Create or update list

Create a natural list, or change the one with this name: whether it is primary, its public name and custom fields.

**Inputs**

- List (`list`, text, required): The list's name. It can't contain a dollar sign ($).
- Primary (`primary`, true/false): Primary lists are the ones subscriber counts and opt-outs are tracked for.
- Public name (`public_name`, text): The name subscribers see, such as on the opt-out page.
- Custom fields (vars) (`vars`, object): Custom fields to store on the list, up to 20.

**Outputs**

- `data` (object): The response from Marigold Engage by Sailthru.

**Example output**

```json
{
  "data": {
    "count": 1,
    "create_time": "example",
    "list": "example",
    "list_id": "example",
    "primary": true,
    "public_name": "example",
    "send_time": "example",
    "type": "example",
    "vars": {}
  }
}
```

### Create or update user

Add a user, or update the one with this email address or ID: custom fields, lists, keys and email opt-out.

**Inputs**

- User (`user`, text, required): The user's email address, or the ID of the type chosen in Find user by.
- Find user by (`find_by`, text): What the user is looked up by. Leave empty for email address. One of: `email` (Email address), `sid` (Sailthru ID (sid)), `extid` (External ID (extid)), `sms` (SMS number).
- Custom fields (vars) (`vars`, object): Custom fields to set, by name, such as first_name.
- Add to lists (`add_to_lists`, list): Lists to subscribe the user to. A list that doesn't exist is created.
- Remove from lists (`remove_from_lists`, list): Lists to take the user off.
- Email opt-out (`optout_email`, text): The user's email opt-out status. One of: `none` (Subscribed to everything), `basic` (Opted out of campaigns only), `all` (Opted out of all email).
- New email address (`new_email`, text): A new email address for the user, to change it.
- External ID (`extid`, text): Your own ID for the user (extid).
- SMS number (`sms`, text): The user's mobile number, in international format such as +15551234567.

**Outputs**

- `data` (object): The response from Marigold Engage by Sailthru.

**Example output**

```json
{
  "data": {
    "engagement": "example",
    "keys": {
      "cookie": "example",
      "email": "example",
      "extid": "example",
      "sid": "example",
      "sms": "example"
    },
    "lists": {},
    "ok": true,
    "optout_email": "example",
    "vars": {}
  }
}
```

### Delete campaign

Delete a campaign that hasn't started sending.

**Inputs**

- Campaign (`campaign_id`, number, required): The campaign. At least 1.

**Outputs**

- `data` (object): The response from Marigold Engage by Sailthru.

**Example output**

```json
{
  "data": {
    "blast_id": 1,
    "ok": true
  }
}
```

### Delete content

Remove an item from the content library, with its data.

**Inputs**

- URL (`url`, text, required): The content item's URL, its identifier in the content library.

**Outputs**

- `data` (object): The response from Marigold Engage by Sailthru.

**Example output**

```json
{
  "data": {
    "ok": true
  }
}
```

### Delete list

Delete a list. Its users stay in the account.

**Inputs**

- List (`list`, text, required): The list, by name.

**Outputs**

- `data` (object): The response from Marigold Engage by Sailthru.

**Example output**

```json
{
  "data": {
    "list": "example",
    "ok": true
  }
}
```

### Delete user

Permanently delete a user's profile, with their purchases and page views.

**Inputs**

- User (`user`, text, required): The user's email address, or the ID of the type chosen in Find user by.
- Find user by (`find_by`, text): What the user is looked up by. Leave empty for email address. One of: `email` (Email address), `sid` (Sailthru ID (sid)), `extid` (External ID (extid)), `sms` (SMS number).

**Outputs**

- `data` (object): The response from Marigold Engage by Sailthru.

**Example output**

```json
{
  "data": {
    "ok": true
  }
}
```

### Get campaign

Get a campaign's name, list, subject, sender, content, schedule and status.

**Inputs**

- Campaign (`campaign_id`, number, required): The campaign. At least 1.

**Outputs**

- `data` (object): The response from Marigold Engage by Sailthru.

**Example output**

```json
{
  "data": {
    "blast_id": 1,
    "content_html": "example",
    "content_text": "example",
    "email_count": 1,
    "end_time": "example",
    "from_email": "example",
    "from_name": "example",
    "labels": [
      "example"
    ],
    "list": "example",
    "modify_time": "example",
    "name": "example",
    "open_total": 1,
    "replyto": "example",
    "schedule_time": "example",
    "start_time": "example",
    "status": "example",
    "subject": "example"
  }
}
```

### Get campaign stats

Get a campaign's totals: messages, opens, clicks, opt-outs, bounces, purchases and revenue.

**Inputs**

- Campaign (`campaign_id`, number, required): The campaign. At least 1.

**Outputs**

- `data` (object): The response from Marigold Engage by Sailthru.

**Example output**

```json
{
  "data": {
    "beacon": 1,
    "click": 1,
    "click_total": 1,
    "confirmed_opens": 1,
    "count": 1,
    "estopens": 1,
    "hardbounce": 1,
    "open_total": 1,
    "optout": 1,
    "purchase": 1,
    "rev": 1,
    "softbounce": 1,
    "spam": 1
  }
}
```

### Get list

Get a list's type, user count, creation and last send time, and custom fields.

**Inputs**

- List (`list`, text, required): The list, by name.

**Outputs**

- `data` (object): The response from Marigold Engage by Sailthru.

**Example output**

```json
{
  "data": {
    "count": 1,
    "create_time": "example",
    "list": "example",
    "list_id": "example",
    "primary": true,
    "public_name": "example",
    "send_time": "example",
    "type": "example",
    "vars": {}
  }
}
```

### Get send

Check a triggered send's delivery status, and when it was opened or clicked. Sends older than 90 days can't be read.

**Inputs**

- Send ID (`send_id`, text, required): The send's ID, which Send triggered email returns.

**Outputs**

- `data` (object): The response from Marigold Engage by Sailthru.

**Example output**

```json
{
  "data": {
    "click_time": "example",
    "email": "example",
    "open_time": "example",
    "schedule_time": "example",
    "send_id": "example",
    "send_time": "example",
    "status": "example",
    "template": "example"
  }
}
```

### Get template

Get a template's subject, sender and content.

**Inputs**

- Template (`template`, text, required): The template, by name.

**Outputs**

- `data` (object): The response from Marigold Engage by Sailthru.

**Example output**

```json
{
  "data": {
    "content_html": "example",
    "content_text": "example",
    "from_email": "example",
    "from_name": "example",
    "is_link_tracking": true,
    "mode": "example",
    "name": "example",
    "public_name": "example",
    "replyto_email": "example",
    "revision_id": 1,
    "subject": "example",
    "template_id": 1
  }
}
```

### Get user

Get a user's profile: their keys, custom fields, lists, engagement and opt-out status.

**Inputs**

- User (`user`, text, required): The user's email address, or the ID of the type chosen in Find user by.
- Find user by (`find_by`, text): What the user is looked up by. Leave empty for email address. One of: `email` (Email address), `sid` (Sailthru ID (sid)), `extid` (External ID (extid)), `sms` (SMS number).
- Return (`fields`, list): Parts of the profile to return. Leave empty for keys, custom fields, lists, engagement and opt-out status. One or more of: `keys` (Keys (email, sid, extid)), `vars` (Custom fields (vars)), `lists`, `engagement` (Engagement level), `optout_email` (Opt-out status), `activity` (Activity times), `lifetime` (Lifetime totals), `purchases`, `purchase_incomplete` (Abandoned cart), `smart_lists` (Smart lists).

**Outputs**

- `data` (object): The response from Marigold Engage by Sailthru.

**Example output**

```json
{
  "data": {
    "activity": {},
    "engagement": "example",
    "keys": {
      "cookie": "example",
      "email": "example",
      "extid": "example",
      "sid": "example",
      "sms": "example"
    },
    "lifetime": {},
    "lists": {},
    "optout_email": "example",
    "purchases": [
      {}
    ],
    "smart_lists": [
      "example"
    ],
    "vars": {}
  }
}
```

### List campaigns

List campaigns with one status: draft, scheduled, sending or sent (newest first).

**Inputs**

- Status (`status`, text, required): Which campaigns to list. One of: `sent`, `scheduled`, `sending`, `created` (Draft (not scheduled)).
- List (`list`, text): Only campaigns sent to this list.
- From (`start_date`, date): Only campaigns from this day on.
- To (`end_date`, date): Only campaigns up to this day.
- Campaigns to return (`limit`, number): How many campaigns to return. Leave empty for 20. From 1 to 1000.
- Campaigns to skip (`skip`, number): How many campaigns to skip, for reading the next page. At least 0.

**Outputs**

- `data` (object): The response from Marigold Engage by Sailthru.

**Example output**

```json
{
  "data": {
    "blasts": [
      {
        "blast_id": 1,
        "email_count": 1,
        "from_email": "example",
        "from_name": "example",
        "labels": [
          "example"
        ],
        "list": "example",
        "modify_time": "example",
        "name": "example",
        "schedule_time": "example",
        "start_time": "example",
        "status": "example",
        "subject": "example"
      }
    ],
    "scheduled_count": 1,
    "sending_count": 1,
    "sent_count": 1,
    "status": "example",
    "unscheduled_count": 1
  }
}
```

### List content

List the most recent items in the content library.

**Inputs**

- Items to return (`items`, number): How many items to return. Leave empty for 20. From 1 to 1000.

**Outputs**

- `data` (object): The response from Marigold Engage by Sailthru.

**Example output**

```json
{
  "data": {
    "content": [
      {
        "author": "example",
        "date": "example",
        "description": "example",
        "expire_date": "example",
        "images": {},
        "inventory": 1,
        "price": 1,
        "site_name": "example",
        "tags": [
          "example"
        ],
        "title": "example",
        "url": "example",
        "vars": {}
      }
    ]
  }
}
```

### List lists

List the account's lists, natural and smart, with how many users each has.

**Inputs**

- Primary lists only (`primary_only`, true/false): Only primary lists.

**Outputs**

- `data` (object): The response from Marigold Engage by Sailthru.

**Example output**

```json
{
  "data": {
    "lists": [
      {
        "create_time": "example",
        "email_count": 1,
        "list_id": "example",
        "name": "example",
        "type": "example",
        "valid_count": 1
      }
    ]
  }
}
```

### List templates

List the account's email templates.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Marigold Engage by Sailthru.

**Example output**

```json
{
  "data": {
    "templates": [
      {
        "is_disabled": true,
        "mode": "example",
        "modify_time": "example",
        "name": "example",
        "subject": "example",
        "template_id": 1
      }
    ]
  }
}
```

### Post custom event

Tell Sailthru a user did something, to start Lifecycle Optimizer flows or triggers listening for that event.

**Inputs**

- User (`user`, text, required): The user's email address, or the ID of the type chosen in Find user by.
- Find user by (`find_by`, text): What the user is looked up by. Leave empty for email address. One of: `email` (Email address), `sid` (Sailthru ID (sid)), `extid` (External ID (extid)), `sms` (SMS number).
- Event name (`event`, text, required): The event's name, such as wishlist_add. It can't be send, cancel, open, click, purchase or daily.
- Custom fields (vars) (`vars`, object): Data to send with the event, for the flow's messages to use.

**Outputs**

- `data` (object): The response from Marigold Engage by Sailthru.

**Example output**

```json
{
  "data": {
    "ok": true
  }
}
```

### Record purchase

Record a user's purchase, or their current cart for abandoned-cart messages.

**Inputs**

- Email (`email`, text, required): The buyer's email address.
- Items (`items`, list, required): The items bought, each with a title, qty (quantity), price (such as 10.99), id (your product ID) and url.
- Cart, not a purchase (`incomplete`, true/false): On to record a cart that hasn't been bought yet.
- Message ID (`message_id`, text): The sailthru_bid cookie's value, to credit the purchase to the email that led to it.
- Receipt template (`send_template`, text): A template to send as the receipt.
- Purchased (`date`, date and time): When the purchase was made. Leave empty for now.
- Custom fields (vars) (`vars`, object): Custom fields to store on the purchase, such as a shipping address.

**Outputs**

- `data` (object): The response from Marigold Engage by Sailthru.

**Example output**

```json
{
  "data": {
    "purchase": {
      "_id": "example",
      "channel": "example",
      "items": [
        {
          "id": "example",
          "price": 1,
          "qty": 1,
          "title": "example",
          "url": "example"
        }
      ],
      "price": 1,
      "qty": 1,
      "time": "example",
      "unique_id": "example"
    }
  }
}
```

### Schedule campaign

Schedule a draft campaign to send at a set time, or now.

**Inputs**

- Campaign (`campaign_id`, number, required): The campaign. At least 1.
- Send at (`schedule_time`, date and time): When to send. Leave empty to send now.

**Outputs**

- `data` (object): The response from Marigold Engage by Sailthru.

**Example output**

```json
{
  "data": {
    "blast_id": 1,
    "email_count": 1,
    "from_email": "example",
    "from_name": "example",
    "labels": [
      "example"
    ],
    "list": "example",
    "modify_time": "example",
    "name": "example",
    "schedule_time": "example",
    "start_time": "example",
    "status": "example",
    "subject": "example"
  }
}
```

### Send triggered email

Send a template to one email address now or at a set time, filling in its variables.

**Inputs**

- Template (`template`, text, required): The template, by name.
- To (`email`, text, required): The email address to send to.
- Template variables (`vars`, object): Values for the template's variables, by name, such as order_id.
- Send at (`schedule_time`, date and time): When to send. Leave empty to send now.
- CC (`cc`, list): Email addresses to copy in.
- BCC (`bcc`, list): Email addresses to blind copy.
- Reply to (`reply_to`, text): The Reply-To address.

**Outputs**

- `data` (object): The response from Marigold Engage by Sailthru.

**Example output**

```json
{
  "data": {
    "click_time": "example",
    "email": "example",
    "open_time": "example",
    "schedule_time": "example",
    "send_id": "example",
    "send_time": "example",
    "status": "example",
    "template": "example"
  }
}
```

### Unschedule campaign

Take a scheduled campaign off the schedule and keep it as a draft.

**Inputs**

- Campaign (`campaign_id`, number, required): The campaign. At least 1.

**Outputs**

- `data` (object): The response from Marigold Engage by Sailthru.

**Example output**

```json
{
  "data": {
    "blast_id": 1,
    "email_count": 1,
    "from_email": "example",
    "from_name": "example",
    "labels": [
      "example"
    ],
    "list": "example",
    "modify_time": "example",
    "name": "example",
    "schedule_time": "example",
    "start_time": "example",
    "status": "example",
    "subject": "example"
  }
}
```

### Update campaign

Change an unsent campaign's name, list, subject, sender or content. Fields left empty stay as they are.

**Inputs**

- Campaign (`campaign_id`, number, required): The campaign. At least 1.
- Name (`name`, text): The new name.
- List (`list`, text): The list to send to, by name.
- Subject (`subject`, text): The subject line.
- From name (`from_name`, text): The sender's name.
- From email (`from_email`, text): The sender's address, one of the account's verified From addresses.
- Reply to (`reply_to`, text): The Reply-To address.
- HTML content (`content_html`, text): The HTML content.
- Text content (`content_text`, text): The plain text content.

**Outputs**

- `data` (object): The response from Marigold Engage by Sailthru.

**Example output**

```json
{
  "data": {
    "blast_id": 1,
    "email_count": 1,
    "from_email": "example",
    "from_name": "example",
    "labels": [
      "example"
    ],
    "list": "example",
    "modify_time": "example",
    "name": "example",
    "schedule_time": "example",
    "start_time": "example",
    "status": "example",
    "subject": "example"
  }
}
```
