Workflow: Capture a customer’s name and email in an AI agent and sync it to Zendesk tickets

<div>
<p>AI agents can collect a customer's name and email during a messaging conversation and pass that information to Zendesk when a ticket is created. This is useful when customers start a conversation as anonymous users and you want the resulting ticket to include their details.</p>
<p>This article provides two workflow options:</p>
<ul>
<li data-list-item-id="e975cb16a9650f01db8cbc93ef3e08a5c">Collect customer details with a customer message block</li>
<li data-list-item-id="e0fa12ba319484fafac78805b1b84f201">Collect customer details with a form in an AI agent message</li>
</ul>
<p>In both workflows, you use an <strong>Update user</strong> action to write the customer's name and email to the Sunshine Conversations user profile before the ticket is created.</p>
</div><div>
<h2 id="h_01KZDG79Y1VSKX17ZGFX8F687J">Before you start</h2>
<p>Before setting up this workflow, make sure that:</p>
<ul>
<li data-list-item-id="e5a76196eed55aec3ee4855a764be12c0">You're using an AI agent with messaging</li>
<li data-list-item-id="e085ce472bbbbbf370b04c92eb29e4502">You have permission to create or edit AI agent flows and actions</li>
<li data-list-item-id="ef550db6639deb627d5d7753c354bb232">You understand your account's messaging email identity settings</li>
</ul>
<p>If you want to associate messaging users with existing Zendesk users before the conversation starts, you also need end-user authentication for messaging using JWT, which requires developer implementation.</p>
</div><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><h2 id="h_01KZDG54JZVC9PYDT282J3SKTY">Option 1: Use a customer message block</h2><div class="accordion"><h3 id="h_01KZDG5CPVEEZM6VQR3RV25J3W"><strong>Step 1: Add message blocks to collect the customer's name and email</strong></h3></div><div class="panel">
<p>Add <a href="https://support.zendesk.com/hc/en-us/articles/9060613203610-Using-the-customer-message-block-in-conversation-flows-for-AI-agents" target="_blank" rel="noopener noreferrer">customer message</a> blocks in the flow before the escalation step. Use one block to ask for the customer's name and another to ask for the customer's email address.</p>
<p>Configure each block to save the customer response as a parameter so you can reuse the values later in the flow.</p>
<p><img class="wysiwyg-image-resized" style="aspect-ratio: 556/315; width: 500px;" src="/attachments/token/QUqJctWLLQyqHpuGF8TeSfrJ1/?name=image.png" width="556" height="315"></p>
<p>Example:</p>
<ul>
<li data-list-item-id="eebf136b92d0053cd440befce1ed6b975">Ask for the customer's name and save it to a parameter such as <code>name</code>
</li>
<li data-list-item-id="e879853e69f50e1473be43f40fc8ea7da">Ask for the customer's email address and save it to a parameter such as <code>email</code>
</li>
</ul>
<p>After the values are collected, reference them in later blocks using the parameter format:</p>
<ul>
<li data-list-item-id="e201d75bc4d68f562cfb15798edf7d939"><code>{{name}}</code></li>
<li data-list-item-id="e0b9380a935d06d0c1f610c52c0f0abd9"><code>{{email}}</code></li>
</ul>
</div><div class="accordion"><h3 id="h_01KZDG8TC889JY22W66KH9QD48"><strong>Step 2: Pass the saved values during escalation</strong></h3></div><div class="panel">
<p>When the flow reaches the escalation path or a specific downstream block, create an <a href="https://support.zendesk.com/hc/en-us/articles/8357756651290-About-configured-actions-for-AI-agents" target="_blank" rel="noopener noreferrer">action</a> and pass the saved parameter values using the parameter formats <code>{{name}}</code> and <code>{{email}}</code>.</p>
<p><img class="wysiwyg-image-resized" style="aspect-ratio: 730/692; width: 500px;" src="https://support.zendesk.com/hc/article_attachments/11110474266266" width="730" height="692"></p>
<p>Using the double angle bracket <code>{{}}</code> format ensures the stored parameter values are passed correctly.</p>
<p><img src="https://support.zendesk.com/hc/article_attachments/11110474266394" width="365" height="364"></p>
</div><h2 id="h_01KZDGN4QKW8DWZP1PFC8CTT97">Option 2: Use a form in an AI agent message</h2><div class="accordion"><h3 id="h_01KZDGX0F1FA350FERCSE0CWNM"><strong>Step 1: Add a form to the AI agent message</strong></h3></div><div class="panel">
<p>Create or select a <a href="https://support.zendesk.com/hc/en-us/articles/8357757976474-Creating-and-managing-structured-message-templates-for-AI-agents#topic_gzn_zdj_jhc" target="_blank" rel="noopener noreferrer">form template</a> that collects the customer's name and email, then add that form to your AI agent message.</p>
<p><img class="wysiwyg-image-resized" style="aspect-ratio: 1442/934; width: 500px;" src="https://support.zendesk.com/hc/article_attachments/11110510026394" width="1442" height="934"></p>
<p><a href="https://support.zendesk.com/hc/en-us/articles/8357757976474-Creating-and-managing-structured-message-templates-for-AI-agents#topic_mgl_3cj_jhc" target="_blank" rel="noopener noreferrer">Add the form template</a> to connect it to the relevant flow or escalation path.</p>
<p><img src="https://support.zendesk.com/hc/article_attachments/11110474266522" width="302" height="364"></p>
</div><div class="accordion"><h3 id="h_01KZDGX0F1R3WH14Z96KFQP60G"><strong>Step 2: Verify the parameter names</strong></h3></div><div class="panel">
<p>Then run a test conversation and review the session data to confirm the exact parameter names created by the form. Check the <a href="https://support.zendesk.com/hc/en-us/articles/8357749580186-Reviewing-conversation-logs-for-AI-agents#topic_rt5_vgf_52c" target="_blank" rel="noopener noreferrer">conversation log</a> for the test conversation and review the session parameters ensuring they are set from the template form.</p>
<p><img class="wysiwyg-image-resized" style="aspect-ratio: 842/911; width: 500px;" src="https://support.zendesk.com/hc/article_attachments/11110474266778" width="842" height="911"></p>
</div><div class="accordion"><h3 id="h_01KZDGX0F1STQ38YHXJQXR6KSP"><strong>Step 3: Create an Update user action</strong></h3></div><div class="panel">
<p>Create an action for Sunshine Conversations that updates the user profile.</p>
<p>Map the form's saved parameter values to these user fields:</p>
<ul>
<li data-list-item-id="e2d86b615471b3847b4af7758a72f364c">givenName = <code>{{name}}</code>
</li>
<li data-list-item-id="ee28dc8182d60db1bb9227e08353adebd">email = <code>{{customerEmail}}</code>
</li>
</ul>
<p>The parameter names in the action must exactly match the ones saved by the form.</p>
<p><img class="wysiwyg-image-resized" style="aspect-ratio: 540/516; width: 500px;" src="https://support.zendesk.com/hc/article_attachments/11110510026906" width="540" height="516"></p>
</div><div class="accordion"><h3 id="h_01KZDGX0F1YJF4KHXSNN8NWH8Q"><strong>Step 4: Add the action with the Escalation</strong></h3></div><div class="panel">
<p>Add the Update user action in the escalation block or in the relevant AI agent configuration so it runs before the ticket is created.</p>
<p>This links the collected form details to the Sunshine Conversations user profile before the ticket is generated.</p>
<p><img class="wysiwyg-image-resized" style="aspect-ratio: 729/422; width: 500px;" src="https://support.zendesk.com/hc/article_attachments/11110474267034" width="729" height="422"></p>
</div><h2 id="h_01KZDGS81PT41F4Q7VXA3JE9HN">Understand how email identity settings affect the ticket requester</h2><div>
<p>Whether the collected email appears on the Zendesk ticket depends on your messaging email identity settings.</p>
<ul>
<li data-list-item-id="eaaed429a238bfc5c59bc74941e8a1140">If your account allows <strong>unverified emails</strong>, the email collected by the AI agent can be added as a user identity and used as the ticket requester</li>
<li data-list-item-id="ed8e82a4999e1490d856cbec8086d685c">If your account allows <strong>only verified emails</strong>, the collected email won't be used as a trusted identity unless the user is authenticated and the email is verified</li>
<li data-list-item-id="e95052b5207712b2da743012a7c7ea38f">In unauthenticated conversations where only verified emails are allowed, the ticket may appear as a conversation with a web user instead of showing the collected email address</li>
</ul>
<p>To learn more about email identities see <a href="https://support.zendesk.com/hc/en-us/articles/4411666638746-Understanding-and-setting-up-end-user-authentication-for-messaging" target="_blank" rel="noopener noreferrer">Understanding and setting up end-user authentication for messaging</a>.</p>
<p>If you want to identify customers against existing user profiles before the conversation starts, use <a href="https://developer.zendesk.com/documentation/conversations/messaging-platform/users/authenticating-users-help-center/" target="_blank" rel="noopener noreferrer">JWT-based end-user authentication for messaging</a>. This requires developer implementation or help from Zendesk Professional Services.</p>
</div>