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(cohorts): add an email this cohort button to the persons table (#118390)

Meikel Ratz4beb7fa6d0fb
diff --git a/frontend/src/scenes/cohorts/CohortEdit.tsx b/frontend/src/scenes/cohorts/CohortEdit.tsx
index b9ddd4bca1e6..a1cc3554dba4 100644
--- a/frontend/src/scenes/cohorts/CohortEdit.tsx
+++ b/frontend/src/scenes/cohorts/CohortEdit.tsx
@@ -61,6 +61,7 @@ import {
captureMessageAudienceClicked,
messageAudienceAccessDisabledReason,
} from 'products/workflows/frontend/MessageAudience/messageAudience'
+import { MessageAudienceButton } from 'products/workflows/frontend/MessageAudience/MessageAudienceButton'
import { messageAudienceOpenLogic } from 'products/workflows/frontend/MessageAudience/messageAudienceOpenLogic'
import { AddPersonToCohortModal } from './AddPersonToCohortModal'
@@ -891,6 +892,18 @@ export function CohortEdit({ id, attachTo }: CohortEditProps): JSX.Element {
fileNameForExport: cohort.name,
cohortId: cohortId,
dataNodeLogicKey: dataNodeLogicKey,
+ customActions: (
+ <MessageAudienceButton
+ key="email-cohort"
+ audience={{
+ ...cohortBroadcastAudience(cohort),
+ source: 'cohort_persons_table',
+ }}
+ destinations={['broadcast']}
+ label="Email this cohort"
+ disabledReason={broadcastDisabledReason}
+ />
+ ),
columns: canRemovePersonFromCohort
? {
'person.$delete': {