> For the complete documentation index, see [llms.txt](https://developer.kizen.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.kizen.com/docs/integrations-and-plugins/integrations/postalytics/sending-mail-from-automations-with-postalytics.md).

# Sending Mail from Agentic Workflows with Postalytics

{% hint style="success" %}
**Audience:** Admins, Developers, <code class="expression">space.vars.automation</code> Builders, Support & Operation teams, and Solution Architects

**Purpose:** Explains how to create an <code class="expression">space.vars.automation</code> that sends mail using Postalytics campaigns.
{% endhint %}

## Overview

{% hint style="warning" %}
**Caution:** This setup reflects <code class="expression">space.vars.Kizen\_company\_name</code>'s default configuration. Your administrator may have customized your layout, so columns or navigation may appear differently. Trial accounts may have limited features.
{% endhint %}

<code class="expression">space.vars.automations</code> let you send Postalytics mail at scale in Kizen by triggering mail sends based on defined events and conditions. This allows you to include physical mail as part of repeatable <code class="expression">space.vars.workflows</code> without manual intervention.

Use <code class="expression">space.vars.automations</code> when you want to:

* Send mail automatically after a specific event or <code class="expression">space.vars.entity</code> update
* Trigger mail for many <code class="expression">space.vars.contacts</code> at once
* Standardize and scale mail-based <code class="expression">space.vars.workflows</code>

***

## Before You Begin

Before creating an <code class="expression">space.vars.automation</code> that sends mail using Postalytics, make sure the following are in place:

* The [Postalytics integration](/docs/integrations-and-plugins/integrations/postalytics/enabling-postalytics.md) is enabled in <code class="expression">space.vars.Kizen\_company\_name</code>
* A Postalytics campaign is created and available to select
* <code class="expression">space.vars.contacts</code> included in the <code class="expression">space.vars.automation</code> contain the required mailing fields:
  * First name
  * Last name
  * Street address
  * City
  * State
  * ZIP code
* You have permission to create and edit <code class="expression">space.vars.automations</code>
* You understand when the <code class="expression">space.vars.automation</code> should trigger and which <code class="expression">space.vars.contacts</code> it should apply to

Having these prerequisites in place ensures the <code class="expression">space.vars.automation</code> can send mail successfully when it runs.

***

{% stepper %}
{% step %}

#### From your Top Navigation, go to **Agentic Workflows**

{% endstep %}

{% step %}

#### From the Agentic Workflow Builder, Select New Agentic Workflow

{% endstep %}

{% step %}

#### Enter your Agentic Workflow Name

{% endstep %}

{% step %}

#### In the **Choose Agentic Workflow Object** dropdown, choose **Contacts**

<div data-with-frame="true"><figure><img src="/files/3QQdEYUEsmsbd8SvEKvz" alt="" width="320"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

#### Select SAVE

{% endstep %}

{% step %}

#### In the Agentic Workflow Builder, add an **Action**

To add an Action, grab the Action button and drag it onto the <code class="expression">space.vars.automation</code> Builder page or you can click the **+** then select **Add Action** from the menu.

<div data-with-frame="true"><figure><img src="/files/vuFIlBIPpPZkxkX0exek" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

#### In the Action Modal under Integrations, select **Postalytics**,

<div data-with-frame="true"><figure><img src="/files/GNthq62syNys6MfELnFa" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

#### Next, Select **Send Drip Campaign** from the Action dropdown

<div data-with-frame="true"><figure><img src="/files/eCgcyizQ1yTOiNO9u2Md" alt="" width="375"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

### From the Agentic Workflow Variable dropdown, choose the **Campaign ID**.

Under **Script Inputs**, configure the **Campaign ID:**

* Set **Input Source** to **Static Value**
* Leave **Data Type** set to **String**
* In the **Value** field, paste your Postalytics Campaign Endpoint ID

<div data-with-frame="true"><figure><img src="/files/9fpdVRWtzWAU6zHtjCri" alt="" width="563"><figcaption></figcaption></figure></div>

{% hint style="info" %}
**Note:** If you have not retrieved your Postalytics Campaign ID, see [Locating your Campaign Endpoint ID in Postalytics](#locating-your-campaign-endpoint-id-in-postalytics).
{% endhint %}
{% endstep %}

{% step %}

#### All other required inputs from the Contact will be pre-populated

&#x20;These are:

* **Last name**
* **Street address**
* **City**
* **State**
* **ZIP code**

You only need to remap fields if you use non-standard <code class="expression">space.vars.contact</code> fields or want to map a different field.

{% hint style="warning" %}
**Caution:** Home phone number fields may not populate correctly in <code class="expression">space.vars.automation</code>-based sends.
{% endhint %}
{% endstep %}

{% step %}

#### Select SAVE

{% endstep %}
{% endstepper %}

Your <code class="expression">space.vars.automation</code> is now ready for the drip campaign you selected.

***

## Testing Sends with Sandbox Mode

The Send Drip Campaign action also includes an optional **Run in Sandbox Environment** input. When set to **Yes**, the send is routed to Postalytics' sandbox environment instead of production, allowing you to validate <code class="expression">space.vars.automation</code> logic and field mapping without generating real mail.

To enable sandbox mode on an <code class="expression">space.vars.automation</code>:

{% stepper %}
{% step %}

#### Under **Script Inputs**, locate the **Run in Sandbox Environment** row

This row appears alongside the other Script Inputs.
{% endstep %}

{% step %}

#### Configure Run in Sandbox Environment values

* Set **Input Source** to **Static Value**.
* Leave **Data Type** set to **Boolean**.
* In the **Value** dropdown, select **Yes** to route sends to sandbox. Leave the Value blank or select **No** for production sends.
  {% endstep %}

{% step %}

#### In the **Value** dropdown, select **Yes**

To route sends to production instead, leave **Value** blank or select **No**.

<div data-with-frame="true"><figure><img src="/files/qMV1iQ5wPiuQq2QKMQT3" alt="" width="563"><figcaption></figcaption></figure></div>

{% hint style="info" %}
**Note:** Because **Run in Sandbox Environment** is an optional input, it can be left unconfigured. If you do not set a value, the send defaults to production.
{% endhint %}
{% endstep %}

{% step %}

#### Select **SAVE**

{% endstep %}
{% endstepper %}

### Sandbox API Credentials

Sandbox sends require separate Postalytics API credentials from your production integration. These credentials are configured per user in your user settings. If you attempt a sandbox send without sandbox credentials configured, the <code class="expression">space.vars.automation</code> step will fail with an authentication error.

### Verifying Sandbox Sends

Sandbox sends do not produce physical mail. To confirm that a sandbox send was received by Postalytics, review the reports and activity logs in the Postalytics dashboard. For details, review [Postalytics documentation](https://docs.postalytics.com/what-is-the-postalytics-direct-mail-api).

{% hint style="info" %}
**Note:** Sandbox mode is configured per <code class="expression">space.vars.automation</code>. A single <code class="expression">space.vars.automation</code> can include both sandbox and production sends if you need a staged rollout.
{% endhint %}

***

## **Agentic Workflow Runtime Behavior** <a href="#automation-runtime-behavior" id="automation-runtime-behavior"></a>

Once a Postalytics <code class="expression">space.vars.automation</code> is configured and saved, it runs automatically whenever its trigger conditions are met. No further user action is required.

When the <code class="expression">space.vars.automation</code> runs:

* Kizen validates required Contact mailing fields
* Kizen sends the Contact data and campaign endpoint ID to Postalytics
* Postalytics queues the mail for printing and delivery

<code class="expression">space.vars.automation</code> sends are asynchronous. A successful run indicates the send request was accepted by Postalytics, not that the mail has been delivered.

### **Verifying and Monitoring Agentic Workflow Sends** <a href="#verifying-and-monitoring-automation-sends" id="verifying-and-monitoring-automation-sends"></a>

You can monitor <code class="expression">space.vars.automation</code> behavior in the following ways:

* **Agentic Workflow run history:** Each execution appears in the <code class="expression">space.vars.automation</code>’s run history. Successful runs indicate the send completed without errors.
* **Failure notifications:** If a send fails, the run is marked **Status: failed**, and the <code class="expression">space.vars.automation</code> owner receives an email notification with error details.
* **Postalytics dashboard:** Delivery and mailing status are managed in Postalytics and are not tracked in <code class="expression">space.vars.Kizen\_company\_name</code>.

***

## Locating your Campaign Endpoint ID in Postalytics

To create an action for a Postalytics <code class="expression">space.vars.automation</code>, <code class="expression">space.vars.Kizen\_company\_name</code> needs to know which specific Postalytics campaign to trigger when the <code class="expression">space.vars.automation</code> runs. In <code class="expression">space.vars.Kizen\_company\_name</code>, this is called the **Campaign endpoint ID.**

{% stepper %}
{% step %}

#### In Postalytics, select **Campaigns** > **View Campaigns**

<div data-with-frame="true"><figure><img src="/files/VfgrJaxtCQkczKP5uu1c" alt="" width="222"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

#### Select the ellipses to open the **Campaign menu**, then choose **Settings**

<div data-with-frame="true"><figure><img src="/files/FDQlCBQzcLfAWH9BZX11" alt="" width="563"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

#### In Settings, copy the **Campaign Endpoint**

<div data-with-frame="true"><figure><img src="/files/w4SEHljlDk2gguIrexce" alt="" width="410"><figcaption></figcaption></figure></div>
{% endstep %}
{% endstepper %}

You should now have the Postalytics Campaign Endpoint ID. For more information on Postalytics Campaigns, visit the [Postalytics Support Center](https://support.postalytics.com/support/home).

***

## What's Next

Next, review [Sending Mail from a Contact Record with Postalytics](/docs/integrations-and-plugins/integrations/postalytics/sending-mail-from-a-contact-record-with-postalytics.md) to learn how to send one-time mail directly from individual <code class="expression">space.vars.contact</code> <code class="expression">space.vars.entities</code>.

For broader context, you can also revisit the [Postalytics Overview](/docs/integrations-and-plugins/integrations/postalytics.md) to understand available actions, common use cases, and error handling across the integration.

<details>

<summary>Related Topics</summary>

* [Postalytics](/docs/integrations-and-plugins/integrations/postalytics.md)
* [Enabling Postalytics](/docs/integrations-and-plugins/integrations/postalytics/enabling-postalytics.md)
* [Sending Mail from a Contact Record with Postalytics](/docs/integrations-and-plugins/integrations/postalytics/sending-mail-from-a-contact-record-with-postalytics.md)

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developer.kizen.com/docs/integrations-and-plugins/integrations/postalytics/sending-mail-from-automations-with-postalytics.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
