Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(conversations): add copy email button to customer tile (#73457)

Xander0809848ba275
diff --git a/frontend/src/scenes/persons/PersonDisplay.tsx b/frontend/src/scenes/persons/PersonDisplay.tsx
index 03761436a6ec..dc1d52d32cfa 100644
--- a/frontend/src/scenes/persons/PersonDisplay.tsx
+++ b/frontend/src/scenes/persons/PersonDisplay.tsx
@@ -6,6 +6,7 @@ import { router } from 'kea-router'
import React, { useMemo, useState } from 'react'
import { IconCopy } from '@posthog/icons'
+import { LemonButton } from '@posthog/lemon-ui'
import { FEATURE_FLAGS } from 'lib/constants'
import { Link } from 'lib/lemon-ui/Link'
@@ -33,6 +34,7 @@ export interface PersonDisplayProps {
isCentered?: boolean
children?: React.ReactChild
withCopyButton?: boolean
+ withCopyEmailButton?: boolean
withComposeTicketButton?: boolean
placement?: 'top' | 'bottom' | 'left' | 'right'
inline?: boolean
@@ -86,6 +88,7 @@ export function PersonDisplay({
href = asLink(person),
children,
withCopyButton,
+ withCopyEmailButton,
withComposeTicketButton,
placement,
inline,
@@ -123,6 +126,25 @@ export function PersonDisplay({
/>
)}
<span className={clsx('ph-no-capture', !noEllipsis && 'truncate')}>{display}</span>
+ {withCopyEmailButton && personEmail && (
+ <span
+ className="ml-1 shrink-0"
+ onClick={(e) => {
+ e.stopPropagation()
+ e.preventDefault()
+ setVisible(false)
+ }}
+ >
+ <LemonButton
+ size="xsmall"
+ type="tertiary"
+ icon={<IconCopy />}
+ tooltip="Copy email"
+ onClick={() => void copyToClipboard(personEmail, 'email')}
+ data-attr="copy-person-email-button"
+ />
+ </span>
+ )}
{showComposeButton && personDistinctId && (
<span
className="ml-1 shrink-0"
diff --git a/products/conversations/frontend/scenes/ticket/SupportTicketScene.tsx b/products/conversations/frontend/scenes/ticket/SupportTicketScene.tsx
index 062667b1a85d..7c177234af95 100644
--- a/products/conversations/frontend/scenes/ticket/SupportTicketScene.tsx
+++ b/products/conversations/frontend/scenes/ticket/SupportTicketScene.tsx
@@ -265,6 +265,7 @@ export function SupportTicketScene({ ticketId }: { ticketId: string }): JSX.Elem
}
}
withIcon
+ withCopyEmailButton
withComposeTicketButton
/>
<IdentityBadge verified={ticket.identity_verified} />