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(workflows): show sends skipped for a missing email address (#120243)

Meikel Ratzf6efcf0539f8
diff --git a/products/workflows/frontend/Workflows/EmailMetricsSummary.tsx b/products/workflows/frontend/Workflows/EmailMetricsSummary.tsx
index d7423626c048..022c892f4b1e 100644
--- a/products/workflows/frontend/Workflows/EmailMetricsSummary.tsx
+++ b/products/workflows/frontend/Workflows/EmailMetricsSummary.tsx
@@ -53,11 +53,13 @@ export function EmailMetricsSummary({
)
const sentTotal = sumTimeSeries(getSingleTrendSeries('email_sent'))
- // A frequency-capped send is skipped before the provider sees it, so it is not part of `sent`.
- // Its rate reads against every attempted send, the same denominator as the Issues column.
+ // A frequency-capped send or a send with no recipient is skipped before the provider sees it, so
+ // it is not part of `sent`. Its rate reads against every attempted send, the same denominator as
+ // the Issues column.
const attemptedTotal =
sentTotal +
sumTimeSeries(getSingleTrendSeries('email_bounce_prevented')) +
+ sumTimeSeries(getSingleTrendSeries('email_missing_recipient')) +
sumTimeSeries(getSingleTrendSeries('message_frequency_capped'))
return (
@@ -66,7 +68,7 @@ export function EmailMetricsSummary({
{EMAIL_METRIC_KEYS.map((key) => {
const metric = WORKFLOW_EMAIL_METRICS[key]
const canDrillDown = !!onMetricClick && !!EMAIL_METRIC_INVOCATION_FILTERS[key]
- const readsAgainstAttempts = key === 'message_frequency_capped'
+ const readsAgainstAttempts = key === 'message_frequency_capped' || key === 'email_missing_recipient'
const shareTotal = readsAgainstAttempts ? attemptedTotal : sentTotal
const share =
key !== 'email_sent' && shareTotal > 0
diff --git a/products/workflows/frontend/Workflows/WorkflowMetricsSummary.tsx b/products/workflows/frontend/Workflows/WorkflowMetricsSummary.tsx
index 5da1ae19ed60..6484bad03e8d 100644
--- a/products/workflows/frontend/Workflows/WorkflowMetricsSummary.tsx
+++ b/products/workflows/frontend/Workflows/WorkflowMetricsSummary.tsx
@@ -28,7 +28,7 @@ const TRACKED_SENDS_TOOLTIP =
'Untracked sends can never record opens or clicks, so engagement is shown against tracked sends (sent minus untracked). Counts and rates compare activity within the selected date range, so opens of emails sent before the range can push a rate above 100%.'
const ISSUE_RATES_TOOLTIP =
- 'Bounces and spam complaints are shown as a share of emails sent. A prevented bounce or a frequency-capped send is skipped before it is sent, so it is shown as a share of every send the step attempted (sent plus skipped).'
+ 'Bounces and spam complaints are shown as a share of emails sent. A prevented bounce, a send with no email address, or a frequency-capped send is skipped before it is sent, so it is shown as a share of every send the step attempted (sent plus skipped).'
// Opens and clicks are only possible on tracked sends, so pair the raw count with the denominator it
// should be read against, plus the rate over that denominator. A step with no tracked sends shows a
@@ -127,10 +127,10 @@ export function WorkflowMetricsSummary({
key: 'issues',
tooltip: ISSUE_RATES_TOOLTIP,
render: (_, row) => {
- // A prevented bounce or a frequency-capped send is skipped before the provider sees
- // it, so neither is part of `sent` and their rates read against everything the
- // step attempted to send.
- const attempted = row.sent + row.bouncePrevented + row.frequencyCapped
+ // A prevented bounce, a missing recipient, or a frequency-capped send is skipped
+ // before the provider sees it, so none is part of `sent` and their rates read
+ // against everything the step attempted to send.
+ const attempted = row.sent + row.bouncePrevented + row.missingRecipient + row.frequencyCapped
const classifiedBounces = row.bouncedHard + row.bouncedSoft + row.bouncedUnknown
const bounceIssues: { label: string; value: number; metric: EmailMetricName }[] = [
{ label: 'hard bounced', value: row.bouncedHard, metric: 'email_bounced_hard' },
@@ -168,6 +168,13 @@ export function WorkflowMetricsSummary({
type: 'warning' as const,
metric: 'email_bounce_prevented' as EmailMetric,
},
+ {
+ label: 'no email address',
+ value: row.missingRecipient,
+ total: attempted,
+ type: 'warning' as const,
+ metric: 'email_missing_recipient' as EmailMetric,
+ },
{
label: 'frequency capped',
value: row.frequencyCapped,
diff --git a/products/workflows/frontend/Workflows/workflowMetricsSummaryLogic.test.ts b/products/workflows/frontend/Workflows/workflowMetricsSummaryLogic.test.ts
index 14c9cb8567f0..68a5b80c64c4 100644
--- a/products/workflows/frontend/Workflows/workflowMetricsSummaryLogic.test.ts
+++ b/products/workflows/frontend/Workflows/workflowMetricsSummaryLogic.test.ts
@@ -119,6 +119,19 @@ describe('buildEmailMetricInvocationSearchParams', () => {
'email_bounce_prevented',
{ inv_date_from: dateFrom, inv_date_to: dateTo, inv_search: 'Skipping send', inv_log_levels: 'INFO' },
],
+ [
+ 'email_missing_recipient',
+ {
+ inv_date_from: dateFrom,
+ inv_date_to: dateTo,
+ inv_search: 'has no email address',
+ inv_log_levels: 'WARN',
+ },
+ ],
+ [
+ 'email_suspended',
+ { inv_date_from: dateFrom, inv_date_to: dateTo, inv_search: 'for this project', inv_log_levels: 'WARN' },
+ ],
[
'message_frequency_capped',
{
@@ -188,6 +201,7 @@ describe('buildEmailMetricRows', () => {
email_bounced_hard: 4,
email_bounced_transient: 2,
email_bounce_prevented: 2,
+ email_missing_recipient: 5,
message_frequency_capped: 3,
email_blocked: 4,
email_untracked: 7,
@@ -206,6 +220,7 @@ describe('buildEmailMetricRows', () => {
bouncedSoft: 2,
bouncedUnknown: 0,
bouncePrevented: 2,
+ missingRecipient: 5,
frequencyCapped: 3,
markedAsSpam: 4,
untracked: 7,
diff --git a/products/workflows/frontend/Workflows/workflowMetricsSummaryLogic.ts b/products/workflows/frontend/Workflows/workflowMetricsSummaryLogic.ts
index c1fe82489f79..99cb2b67cbea 100644
--- a/products/workflows/frontend/Workflows/workflowMetricsSummaryLogic.ts
+++ b/products/workflows/frontend/Workflows/workflowMetricsSummaryLogic.ts
@@ -115,6 +115,7 @@ export type EmailMetric =
| 'email_link_clicked'
| 'email_bounced'
| 'email_bounce_prevented'
+ | 'email_missing_recipient'
| 'email_blocked'
| 'email_untracked'
| 'email_suspended'
@@ -155,6 +156,7 @@ export type EmailMetricRow = {
bouncedSoft: number
bouncedUnknown: number
bouncePrevented: number
+ missingRecipient: number
frequencyCapped: number
// Spam complaints. Stored under the email_blocked metric name for continuity with
// historical data (see the SES webhook handler's Complaint mapping).
@@ -198,6 +200,7 @@ export const METRIC_COLORS: Record<string, string> = {
'Link clicked': getColorVar('data-color-5'),
Bounced: getColorVar('data-color-6'),
'Bounce prevented': getColorVar('data-color-7'),
+ 'No email address': getColorVar('data-color-13'),
'Frequency capped': getColorVar('data-color-8'),
'Marked as spam': getColorVar('data-color-9'),
Untracked: getColorVar('data-color-10'),
@@ -305,6 +308,13 @@ export const WORKFLOW_EMAIL_METRICS: Record<
color: METRIC_COLORS['Bounce prevented'],
metricNames: ['email_bounce_prevented'],
},
+ email_missing_recipient: {
+ name: 'No email address',
+ description:
+ 'Total number of emails that were not sent because the recipient had no email address, for example a person without an email property. Add a filter so only people with an email address reach the step. These sends are not billed.',
+ color: METRIC_COLORS['No email address'],
+ metricNames: ['email_missing_recipient'],
+ },
message_frequency_capped: {
name: 'Frequency capped',
description:
@@ -394,10 +404,13 @@ export const EMAIL_METRIC_INVOCATION_FILTERS: Partial<
email_bounced_undetermined: { search: 'Undetermined bounce', levels: ['WARN'] },
// MX-validation skips log "Skipping send: …" at INFO (see HogFunctionHandler in the plugin server).
email_bounce_prevented: { search: 'Skipping send', levels: ['INFO'] },
+ // A missing recipient logs "Skipping send: the recipient has no email address. …" at WARN (EmailService).
+ email_missing_recipient: { search: 'has no email address', levels: ['WARN'] },
message_frequency_capped: { search: 'reached the frequency cap', levels: ['INFO'] },
email_blocked: { search: 'Complaint', levels: ['WARN', 'ERROR'] },
- // Suspension skips log "Skipping send: email sending is suspended …" at WARN (EmailService).
- email_suspended: { search: 'Skipping send', levels: ['WARN'] },
+ // Both suspension causes log "Skipping send: … for this project. …" at WARN (EmailService). The
+ // narrower term keeps other WARN skips, such as a missing recipient, out of this drill-down.
+ email_suspended: { search: 'for this project', levels: ['WARN'] },
// A per-workflow pause logs "Skipping send: … paused …" at ERROR (EmailService). The search
// term stays generic because the staff and automatic pauses word the line differently.
email_paused: { search: 'Skipping send', levels: ['ERROR'] },
@@ -439,6 +452,7 @@ const EMAIL_METRICS: EmailMetricName[] = [
'email_bounced_transient',
'email_bounced_undetermined',
'email_bounce_prevented',
+ 'email_missing_recipient',
'email_blocked',
'email_untracked',
'email_suspended',
@@ -1593,6 +1607,7 @@ export function buildEmailMetricRows(
bouncedSoft: totals.email_bounced_transient ?? 0,
bouncedUnknown: totals.email_bounced_undetermined ?? 0,
bouncePrevented: totals.email_bounce_prevented ?? 0,
+ missingRecipient: totals.email_missing_recipient ?? 0,
frequencyCapped: totals.message_frequency_capped ?? 0,
markedAsSpam,
untracked,