Skip to content

feat: add suggested_email to agent and customer customer objects (v3.6) - #233

Merged
mdojwa merged 1 commit into
v3.6from
EUEE-1740-suggested-email-v3.6
Sep 8, 2026
Merged

feat: add suggested_email to agent and customer customer objects (v3.6)#233
mdojwa merged 1 commit into
v3.6from
EUEE-1740-suggested-email-v3.6

Conversation

@mdojwa

@mdojwa mdojwa commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Jira: EUEE-1740

suggested_email is an email address captured for a customer without their
confirmation
— the chat widget proposes one, an agent then accepts it (sets
email, clears the suggestion) or dismisses it. Both sides need it: the widget
writes it through the customer API, the agent reads and resolves it through the
agent API.

Declared following phone_number, in four places:

  • src/agent/structures/users.ts — the agent-side Customer
  • src/agent/structures/structures.tsCustomerParameters for update_customer
  • src/customer/structures/users.ts — the customer-side Customer
  • src/customer/structures/structures.ts — customer CustomerParameters

No version-specific shape here, unlike the Go SDK

CustomerParameters is a plain object and updateCustomer spreads it into the
payload, so an empty value reaches the wire on its own — no pointer gymnastics
needed. An empty value reaches the wire the same way, but 3.6 ignores it — clearing a suggestion requires 3.7.

The Go SDK has to model this explicitly, because its request fields are plain
strings on v3.6 and pointers on v3.7.

Verification

npm run build (tsc --build) clean. This repo has no test suite, and the change is
type declarations only — the field flows through { ...opts } untouched — so the
compiler is the whole check available.

Do not release before the API chain is deployed

The agent-side half of this field is added across several stacked PRs in
livechat/api. Until that whole chain is merged and deployed, an agent
update_customer carrying only suggested_email fails validation, and the agent
get_customer never returns it. These are type declarations only, so nothing
breaks — but the types would promise a field the backend does not yet honour.

docs/ deliberately not regenerated

The committed typedoc output under docs/ is refreshed in dedicated commits at
release time (regenerate docs, update docs and bump version), not per feature —
and it is already behind: docs/interfaces/customer_structures_users.Customer.md and
the customer CustomerParameters page still lack phone_number, which the code has
carried since EUEE-1585. Regenerating here would bury this one-field change under an
unrelated catch-up diff, so it is left for the next release regeneration.

Related

EUEE-1740. suggested_email is an email address captured for a customer without
their confirmation - the widget proposes one, an agent accepts or dismisses it.
Both sides need it: the widget writes it through the customer API, the agent
reads and resolves it through the agent API.

Declared on the Customer objects, on CustomerParameters for update_customer, and
on LoginCustomer, following phone_number. The login path matters because
customer-api accepts customer.suggested_email on login the same way it accepts
phone_number, so leaving it off LoginCustomer would fail excess-property
checking for callers that set it there.

Nothing version-specific to model here, unlike the Go SDK: CustomerParameters is
a plain object, so an empty value reaches the wire on its own.
@mdojwa
mdojwa force-pushed the EUEE-1740-suggested-email-v3.6 branch from d53b5b2 to eea3099 Compare August 28, 2026 12:11
@mdojwa
mdojwa marked this pull request as ready for review August 29, 2026 15:57
@mdojwa
mdojwa requested a review from a team as a code owner August 29, 2026 15:57
Copilot AI balanced review requested due to automatic review settings August 29, 2026 15:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Pull request overview

Adds suggested_email typing for customer suggestion workflows in the v3.6 agent and customer APIs.

Changes:

  • Exposes suggested_email on agent/customer objects.
  • Supports it in customer updates and RTM login data.
File summaries
File Description
src/customer/structures/users.ts Adds the field to customer-side customer objects.
src/customer/structures/structures.ts Adds the field to update and login parameters.
src/agent/structures/users.ts Adds the field to agent-visible customer objects.
src/agent/structures/structures.ts Adds the field to agent update parameters.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@mdojwa
mdojwa merged commit f098b1c into v3.6 Sep 8, 2026
3 checks passed
@mdojwa
mdojwa deleted the EUEE-1740-suggested-email-v3.6 branch September 8, 2026 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants