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

# Setting Up or Altering a Category

> A technical walkthrough for allGood admins on how to configure email categories, extract data, and define automated actions in Reply Management.

## Overview

Reply Management gives you full control over how incoming emails are classified and acted on. You can work from the out-of-the-box (OOTB) categories that come pre-configured, edit them to fit your use case, or build entirely new categorizations and workflows from scratch.

Every category workflow is made up of three parts:

<Frame>
  <video autoPlay muted loop src="https://mintcdn.com/allgoodtechnologyinc/D1l0pVE3YEMmeb1o/videos/ERM-Overview-GIF.mp4?fit=max&auto=format&n=D1l0pVE3YEMmeb1o&q=85&s=5a8bd386c593cba953a93b8264efb97b" controls data-path="videos/ERM-Overview-GIF.mp4" />
</Frame>

<Steps>
  <Step title="Define your categorization criteria">
    Tell Mary what kind of email belongs in this category by giving her a name and a plain-English prompt.
  </Step>

  <Step title="Determine which data to pull from the email">
    Optionally define fields for Mary to extract from matched emails, and configure any data fetches from external systems like Marketo.
  </Step>

  <Step title="Decide which actions to trigger">
    Configure what happens automatically once an email is classified — forwarding, syncing to Marketo, adding to a static list, or requesting a campaign.
  </Step>
</Steps>

***

## Part 1: Configuring the Category

Navigate to **Reply Management → Categories & Actions**, then either click an existing category to edit it or click **+ Add Category** to create a new one.

<Frame>
  <video autoPlay muted loop src="https://mintcdn.com/allgoodtechnologyinc/D1l0pVE3YEMmeb1o/videos/Category-Edit-GIF.mp4?fit=max&auto=format&n=D1l0pVE3YEMmeb1o&q=85&s=c21c807dcd3a43f9a17bc862dc21d15d" controls data-path="videos/Category-Edit-GIF.mp4" />
</Frame>

### Category Name

The category name is a label for your own reference — it appears in the UI and in the Messages view, but it has no effect on how Mary classifies emails. Name it whatever is clear and meaningful to your team (e.g., "Unsubscribe", "Left Company", "Human Request").

### Prompt

The prompt is the most important part of the category. **Everything else in the workflow depends on Mary classifying the email correctly, and the prompt is how she makes that call.**

Write it in plain English — describe the kind of email you want Mary to route into this category. Be as specific as you can, including:

* The signals or phrases that indicate a match
* Any edge cases or look-alikes she should *not* classify here

**Example:**

> *"Automatic replies saying the person doesn't work at that company anymore. Messages like 'John no longer works here' or 'This employee has left the organization.' No new contact info is provided."*

<Tip>
  **Prompt writing tip:** LLMs understand LLM-style instructions best. Before finalizing a prompt, paste it into ChatGPT, Claude or Gemini and test it against a few sample emails. Iterating your prompt through an LLM first can noticeably improve classification reliability before you ever hand it off to Mary.
</Tip>

### Advanced Settings — Category Type

<Note>
  The **Advanced** section is intended for allGood admins. Incorrect category type configuration can affect how emails are routed and how credits are consumed.
</Note>

<Frame>
  <video autoPlay muted loop src="https://mintcdn.com/allgoodtechnologyinc/D1l0pVE3YEMmeb1o/videos/Category-Type-GIF.mp4?fit=max&auto=format&n=D1l0pVE3YEMmeb1o&q=85&s=cad04b6882c67b1a2076ed6b22a5be36" controls data-path="videos/Category-Type-GIF.mp4" />
</Frame>

The **Category Type** dropdown lets you assign a technical email type to a category. When set, Mary will **automatically route emails** that carry matching headers from your email provider into this category — completely bypassing the AI classification prompt. This saves tokens and speeds up processing for email types that are deterministic.

For example: if you set the Category Type to **"Auto Response"**, any incoming email whose mail server headers flag it as an auto-response will be routed directly into this category without consuming a classification credit.

Available category types map to standard email header classifications (e.g., Auto Response, Bounce). Use this when you have a category that captures a well-defined, header-identifiable email type.

***

## Part 2: Extracting Data from the Email

Once an email is classified, Mary can extract specific pieces of information from the email body before any actions run. This is configured in the **Data & Fields** panel, accessible by clicking **Extract Data** on a category row.

<Frame>
  <video autoPlay muted loop src="https://mintcdn.com/allgoodtechnologyinc/D1l0pVE3YEMmeb1o/videos/Extract-Data-GIF.mp4?fit=max&auto=format&n=D1l0pVE3YEMmeb1o&q=85&s=281ffde6ae0dd9dc8f70d49bffefad65" controls data-path="videos/Extract-Data-GIF.mp4" />
</Frame>

### Adding Extract Fields

<Steps>
  <Step title="Click '+ Add Field'">
    This adds a new field definition to the category.
  </Step>

  <Step title="Name your field">
    Give the field a programmatic name — this is the variable name you'll reference in actions later. Use camelCase for consistency (e.g., `newContactEmail`, `returnDate`).
  </Step>

  <Step title="Describe what Mary should look for">
    Write a plain-English description of the value to extract. Be specific about what you want and when it might not be present.

    **Example:** `"Email address of a replacement contact, if provided"`
  </Step>

  <Step title="Mark as Required if needed">
    If the field is essential for downstream actions to work correctly, check **Required**. If a required field can't be found in the email, the item will be flagged for review rather than processed automatically.
  </Step>
</Steps>

You can add as many fields as needed per category.

### Fetching Data from Marketo

If your actions need information from Marketo that isn't in the email itself (e.g., lead owner, current lifecycle stage, or any other CRM field), you can pull that data before the action runs.

<Frame>
  <video autoPlay muted loop src="https://mintcdn.com/allgoodtechnologyinc/D1l0pVE3YEMmeb1o/videos/Fetch-Marketo-Lead-GIF.mp4?fit=max&auto=format&n=D1l0pVE3YEMmeb1o&q=85&s=16848024c3765c5d96e74891c19da238" controls data-path="videos/Fetch-Marketo-Lead-GIF.mp4" />
</Frame>

1. Click **+ Add Fetcher** and select **Fetch Marketo Lead**
2. Configure how the lead should be looked up — typically by **Email address**
3. Select the Marketo fields you want fetched and made available to downstream actions

#### Advanced Fetcher Options

<Note>
  The fetcher **Advanced** settings are for allGood admins.
</Note>

The **Advanced** tab on the fetcher lets you define conditional fetch logic — for example, only fetch the Marketo lead if the email subject equals "I'm Interested". This prevents unnecessary API calls for emails where the data isn't needed.

You can also configure the **behavior when a lead is not found in Marketo**:

| Option                                  | Behavior                                                                   |
| --------------------------------------- | -------------------------------------------------------------------------- |
| **Continue processing with empty data** | The workflow proceeds; fields that required the Marketo data will be empty |
| **Stop processing and flag for review** | The item is held back and marked for manual review                         |

***

## Part 3: Configuring Actions

Actions are the downstream automations that fire once an email has been classified (and data extracted). Click **Actions** on any category row to open the actions panel, then click **+ Add Action** and select from the following four action types.

<Frame>
  <video autoPlay muted loop src="https://mintcdn.com/allgoodtechnologyinc/D1l0pVE3YEMmeb1o/videos/Action-Selection-GIF.mp4?fit=max&auto=format&n=D1l0pVE3YEMmeb1o&q=85&s=ddc4731586d4c8e15dd05a65e3a4a03c" controls data-path="videos/Action-Selection-GIF.mp4" />
</Frame>

***

### Forward Email

Forwards the classified email to a specified recipient.

<Frame>
  <video autoPlay muted loop src="https://mintcdn.com/allgoodtechnologyinc/D1l0pVE3YEMmeb1o/videos/Forward-Email-GIF.mp4?fit=max&auto=format&n=D1l0pVE3YEMmeb1o&q=85&s=e35a8a2c7de167eea492689499c60a0c" controls data-path="videos/Forward-Email-GIF.mp4" />
</Frame>

| Field                      | Description                                             |
| -------------------------- | ------------------------------------------------------- |
| **To address**             | The email address to forward to                         |
| **Subject**                | Subject line for the forwarded email                    |
| **Message**                | Optional message to include above the forwarded content |
| **Include original email** | Choose: Quoted, Inline, or Excluded                     |

<AccordionGroup>
  <Accordion title="Advanced options (Admin only)">
    | Option            | Description                                     |
    | ----------------- | ----------------------------------------------- |
    | **Message style** | Controls how the forwarded message is formatted |
    | **CC**            | Add CC recipients to the forwarded email        |
    | **Reply-to**      | Override the reply-to address                   |
    | **From name**     | Set the display name for the sender             |
  </Accordion>
</AccordionGroup>

***

### Sync Lead to Marketo

Updates one or more fields on a Marketo lead record when an email is classified.

<Frame>
  <video autoPlay muted loop src="https://mintcdn.com/allgoodtechnologyinc/D1l0pVE3YEMmeb1o/videos/Sync-Lead-to-Marketo-GIF.mp4?fit=max&auto=format&n=D1l0pVE3YEMmeb1o&q=85&s=abbc41074564db46513caacaeee84d8f" controls data-path="videos/Sync-Lead-to-Marketo-GIF.mp4" />
</Frame>

| Field          | Description                                                                                                      |
| -------------- | ---------------------------------------------------------------------------------------------------------------- |
| **Field name** | The Marketo field to update                                                                                      |
| **Value**      | The value to set — can be a static value or a dynamic variable (e.g., `{{ classification }}`, `{{ rationale }}`) |

Click **+ Add Field** to update multiple Marketo fields in a single action.

<AccordionGroup>
  <Accordion title="Advanced options (Admin only)">
    | Option                | Description                                                                   |
    | --------------------- | ----------------------------------------------------------------------------- |
    | **Identify lead by**  | The email address field used to look up the lead in Marketo                   |
    | **Sync action**       | Choose: **Create or Update**, **Create Only**, or **Update Only**             |
    | **Skip if not found** | For Update Only mode — skip rather than error if the lead doesn't exist       |
    | **Only runs if**      | Conditional logic — e.g., only sync if `classification` equals `"interested"` |
  </Accordion>
</AccordionGroup>

***

### Add to Marketo Static List

Adds a lead to a Marketo static list when an email is classified.

<Frame>
  <video autoPlay muted loop src="https://mintcdn.com/allgoodtechnologyinc/D1l0pVE3YEMmeb1o/videos/Add-to-Static-List-GIF.mp4?fit=max&auto=format&n=D1l0pVE3YEMmeb1o&q=85&s=31dc6b01efff2ce53e2d0d8a9a901866" controls data-path="videos/Add-to-Static-List-GIF.mp4" />
</Frame>

| Field             | Description                                                  |
| ----------------- | ------------------------------------------------------------ |
| **Email address** | The address to add — typically `{{ from.address }}`          |
| **Static List**   | The target list, entered as a Marketo list ID or Marketo URL |

<Warning>
  The lead must already exist in Marketo before it can be added to a static list. If there's any chance the lead doesn't exist yet, add a **Sync Lead to Marketo** action before this one to ensure the record is created first.
</Warning>

<AccordionGroup>
  <Accordion title="Advanced options (Admin only)">
    | Option                     | Description                                                                 |
    | -------------------------- | --------------------------------------------------------------------------- |
    | **Skip if lead not found** | Check to skip silently if the lead doesn't exist in Marketo                 |
    | **Only runs if**           | Conditional logic — e.g., only add if `classification` equals `"Subscribe"` |
  </Accordion>
</AccordionGroup>

***

### Request Campaign

Triggers a Marketo campaign request for the classified lead.

<Frame>
  <video autoPlay muted loop src="https://mintcdn.com/allgoodtechnologyinc/D1l0pVE3YEMmeb1o/videos/Request-Campaign-GIF.mp4?fit=max&auto=format&n=D1l0pVE3YEMmeb1o&q=85&s=ee41f0f2577e960ff7c385b23b2ba657" controls data-path="videos/Request-Campaign-GIF.mp4" />
</Frame>

| Field             | Description                                                          |
| ----------------- | -------------------------------------------------------------------- |
| **Email address** | The address used to identify the lead when requesting the campaign   |
| **Campaign**      | The target campaign, entered as a Marketo campaign ID or Marketo URL |

<AccordionGroup>
  <Accordion title="Advanced options (Admin only)">
    | Option                     | Description                                                                     |
    | -------------------------- | ------------------------------------------------------------------------------- |
    | **Skip if lead not found** | Check to skip silently if the lead doesn't exist in Marketo                     |
    | **Only runs if**           | Conditional logic — e.g., only request if `classification` equals `"Subscribe"` |
  </Accordion>
</AccordionGroup>

***

### Add to Worksheet

Adds a new item to another allGood worksheet when an email is classified. Optionally triggers the worksheet's flow to process the item automatically.

| Field                           | Description                                                                                                                                                        |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Worksheet Ident**             | The identifier of the target worksheet to add items to                                                                                                             |
| **Include original email item** | When checked, all fields from the original email (subject, body, from, to, classification, rationale, and extracted fields) are included in the new worksheet item |
| **Fields**                      | Map of field names to template values for setting fields on the new item. These override any fields included from the original email item                          |

<AccordionGroup>
  <Accordion title="Advanced options (Admin only)">
    | Option           | Description                                                                                                                                                                          |
    | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
    | **Behavior**     | Choose: **Add to Worksheet + Run Flow** (default) to add the item and immediately execute the worksheet's flow, or **Add to Worksheet** to add the item without triggering execution |
    | **Only runs if** | Conditional logic — e.g., only add if `classification` equals `"Interested"`                                                                                                         |
  </Accordion>
</AccordionGroup>

***

## Saving and Publishing

Once you've configured your category, extracted fields, and actions, click **OK** to save your changes. When you're ready to push the configuration live, click **Save & Publish** at the top right of the Categories & Actions page.

<Warning>
  Publishing updates your live configuration immediately. All incoming emails processed after publishing will use the updated category rules.
</Warning>
