feat: add suggested_email to agent and customer customer objects (v3.6) - #233
Merged
Conversation
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
force-pushed
the
EUEE-1740-suggested-email-v3.6
branch
from
August 28, 2026 12:11
d53b5b2 to
eea3099
Compare
mdojwa
marked this pull request as ready for review
August 29, 2026 15:57
There was a problem hiding this comment.
🟢 Approval recommended
Pull request overview
Adds suggested_email typing for customer suggestion workflows in the v3.6 agent and customer APIs.
Changes:
- Exposes
suggested_emailon 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.
marcindebski
approved these changes
Aug 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Jira: EUEE-1740
suggested_emailis an email address captured for a customer without theirconfirmation — the chat widget proposes one, an agent then accepts it (sets
email, clears the suggestion) or dismisses it. Both sides need it: the widgetwrites 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-sideCustomersrc/agent/structures/structures.ts—CustomerParametersforupdate_customersrc/customer/structures/users.ts— the customer-sideCustomersrc/customer/structures/structures.ts— customerCustomerParametersNo version-specific shape here, unlike the Go SDK
CustomerParametersis a plain object andupdateCustomerspreads it into thepayload, 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 istype declarations only — the field flows through
{ ...opts }untouched — so thecompiler 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 agentupdate_customercarrying onlysuggested_emailfails validation, and the agentget_customernever returns it. These are type declarations only, so nothingbreaks — but the types would promise a field the backend does not yet honour.
docs/deliberately not regeneratedThe committed typedoc output under
docs/is refreshed in dedicated commits atrelease time (
regenerate docs,update docs and bump version), not per feature —and it is already behind:
docs/interfaces/customer_structures_users.Customer.mdandthe customer
CustomerParameterspage still lackphone_number, which the code hascarried 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