Workflow: How to view original recipients from an inbound email with Action Builder

<p>Your Zendesk account likely has many email addresses for different brands or aliases. You may want the complete list of addresses the end user adds in the <strong>TO</strong> or <strong>CC</strong> fields. When someone emails several of your Zendesk Support addresses, the system selects one address as the support address for the ticket.</p><p>This workflow shows how to get the full list of recipients with a <a href="https://support.zendesk.com/hc/en-us/articles/8013439366810-Creating-custom-actions-for-auto-assist-and-action-flows" target="_blank" rel="noopener noreferrer">custom action</a> and use it in an <a href="https://support.zendesk.com/hc/en-us/articles/9712284817818-Creating-custom-action-flow-triggers" target="_blank" rel="noopener noreferrer">action flow</a>.</p><div style="margin-bottom: 20px; text-align: right;">
<button id="master-toggle" class="btn fw-semibold text-dark" data-action="expand" style="background-color: #DEF991; border: none; outline: none; border-radius: 7px; padding: 10px 20px; font-size: 15px; transition: background-color 0.2s ease;" onmouseover="this.style.backgroundColor='#cbef6d'" onmouseout="this.style.backgroundColor='#DEF991'">
Expand all tabs
</button>
</div>
<script>
document.addEventListener('DOMContentLoaded', function () {
const toggleBtn = document.getElementById('master-toggle');

toggleBtn.addEventListener('click', function () {
const action = this.getAttribute('data-action');
const headers = document.querySelectorAll('.accordion');

headers.forEach(header => {
const isActive = header.classList.contains('active');
const panel = header.nextElementSibling; // Grabs the corresponding .panel container

if (action === 'expand' && !isActive) {
// Open it by simulating a standard click
header.click();
} else if (action === 'collapse' && isActive) {
// Close it by simulating a standard click
header.click();
}
});

// Flip button text and states
if (action === 'expand') {
this.setAttribute('data-action', 'collapse');
this.textContent = 'Collapse all tabs';
} else {
this.setAttribute('data-action', 'expand');
this.textContent = 'Expand all tabs';
}
});
});
</script><div class="accordion"><h3 id="h_01HXY1BFCAPEN08R87P7ENG6TS">Step 1: Create the custom action</h3></div><div class="panel">
<p>Follow the <a href="https://support.zendesk.com/hc/en-us/articles/8013439366810-Creating-custom-actions-for-auto-assist-and-action-flows" target="_blank" rel="noopener noreferrer">custom action documentation</a> to create a custom action and set up authentication.</p>
<p>To create this custom action:</p>
<ol>
<li data-list-item-id="e073bdecb837816efcf5d35a5f619dfa0">Add an input of type <strong>text</strong> for the <strong>Ticket ID</strong> parameter</li>
<li data-list-item-id="e0f098a6449b05113abd69190580bc5e2">
<p>In the API configuration, enter the details for a GET call to the <a href="https://developer.zendesk.com/api-reference/ticketing/tickets/ticket_audits/" target="_blank" rel="noopener noreferrer">Ticket Audits</a> endpoint. This request doesn't require a body value.</p>
<p>The configuration so far looks like this:</p>
</li>
</ol>
<figure><p><img src="https://support.zendesk.com/hc/article_attachments/10358785051290" alt="Create custom action" width="648" height="674"></p></figure><ol start="3">
<li data-list-item-id="ee00a819d5b9bd43b872a371778d4ad6b">Click <strong>+ Add output</strong> and enter a ticket ID from your account</li>
<li data-list-item-id="e92d9a705d01c1752804ecf500a5633f7">Search the results for <code>original_recipients</code>
</li>
</ol>
<figure><p><img src="https://support.zendesk.com/hc/article_attachments/10358772678042" alt="Search recipients" width="567" height="686"></p></figure><ol start="5">
<li data-list-item-id="eb11256a6239f4673e8ab0e02e810739a">Click <strong>Add</strong> and complete the steps. This adds an output of type <strong>text array</strong>.</li>
<li data-list-item-id="eed397e586d0b33da32ed07617ec649fb">Optionally, add other items of interest, such as the <strong>from</strong> address, to get more outputs:</li>
</ol>
<figure><p><img src="https://support.zendesk.com/hc/article_attachments/10358785051546" alt="Add other times" width="690" height="241"></p></figure><ol start="7"><li data-list-item-id="e58379ed53240936944f3a1883d7d2a14">Click <strong>Save</strong>
</li></ol>
</div><div class="accordion"><h3 id="01HXY1G18XYBGPX37812NDQPP4">Step 2: Create the action flow and add the custom action</h3></div><div class="panel">
<p>To create the action flow:</p>
<ol>
<li data-list-item-id="e27b08994bd9caf8a5d00d30221d7dab9">
<p>Add an action flow trigger. This condition or event causes the action flow to run. For example, this occurs when a ticket is created and the channel is <code>email</code>.</p>
<p><img src="https://support.zendesk.com/hc/article_attachments/10358772678426" alt="Create action flow" width="440" height="538"></p>
</li>
<li data-list-item-id="e61b12c170a35130283dcb647bc4ad8aa">In the visual workflow builder, beneath an existing step, click the <strong>Add step</strong> icon (<img style="height: auto;" src="https://zen-marketing-documentation.s3.amazonaws.com/docs/en/icon_action_flows_add.png" alt="" width="16" id="topic_qyx_dnk_t2c__image_bd3_dbg_w2c">)</li>
<li data-list-item-id="e273db41704610ed5cc573c107ca29781">In the step sidebar, under <strong>Custom actions</strong>, select one of the actions you've <a href="https://support.zendesk.com/hc/en-us/articles/8013439366810" target="_blank" rel="noopener noreferrer">created</a>
</li>
<li data-list-item-id="ee9bc0675b8c57d5f341c66ba21c27afb">Add additional steps as needed to use the custom action's outputs. See <a href="#h_01HXY1GYQDRZ3V1Y2A1VJXG88P">Use the custom action's outputs</a>.</li>
<li data-list-item-id="e5337cd667e21692893f7ff376143537c">Click <strong>Save</strong>
</li>
<li data-list-item-id="eb64ed9fb7468b6f94636882173f6fd8d">When you're ready to use the action flow, click <strong>Activate</strong>
</li>
</ol>
</div><div class="accordion"><h3 id="h_01HXY1GYQDRZ3V1Y2A1VJXG88P">Step 3: Use the custom action's outputs as needed</h3></div><div class="panel">
<p>The custom action returns the outputs you configured. You can use them as variables in other action flow steps.</p>
<p>For example, one simple option is to add an internal note to a ticket with the original recipients list and the end-user address.</p>
<ol>
<li data-list-item-id="e65eb70b30e209307e3f7a4e2c61be914">Add a step to <strong>Update ticket</strong> and set <strong>Ticket ID</strong> as the variable</li>
<li data-list-item-id="eb7180f6861aa1d2faf04167a206afde6">
<p>From <strong>Additional fields</strong>, add <strong>Comment is public &gt; False</strong> and <strong>Comment</strong>:</p>
<figure><p><img src="https://support.zendesk.com/hc/article_attachments/10358772679066" alt="Manipulate data" width="1014" height="581"></p></figure>
</li>
</ol>
<p>For example, add a Google step to send an email, add rows to Google Sheets or Google Drive, or run custom code.</p>
</div>