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.

fix(health-alerts): remove broken email channel from wizard (#66247)

Daniel Marchuk325714df0af0
diff --git a/frontend/src/scenes/health-alerts/healthAlertsWizardConfig.ts b/frontend/src/scenes/health-alerts/healthAlertsWizardConfig.ts
index 792d55645f68..411f33eccf6b 100644
--- a/frontend/src/scenes/health-alerts/healthAlertsWizardConfig.ts
+++ b/frontend/src/scenes/health-alerts/healthAlertsWizardConfig.ts
@@ -20,6 +20,9 @@ export const HEALTH_ALERT_TRIGGERS: WizardTrigger[] = [
},
]
+// Note: `template-email` is intentionally not offered here. It's a hidden template
+// meant only for use inside workflows, not as a standalone destination — the backend
+// rejects it on create, so selecting it in the wizard would 400 on save.
export const HEALTH_ALERT_DESTINATIONS: WizardDestination[] = [
{
key: 'slack',
@@ -42,13 +45,6 @@ export const HEALTH_ALERT_DESTINATIONS: WizardDestination[] = [
icon: '/static/services/microsoft-teams.png',
templateId: 'template-microsoft-teams',
},
- {
- key: 'email',
- name: 'Email',
- description: 'Send an email notification',
- icon: '/static/posthog-icon.svg',
- templateId: 'template-email',
- },
{
key: 'webhook',
name: 'Webhook',
diff --git a/frontend/src/scenes/hog-functions/sub-templates/sub-templates.ts b/frontend/src/scenes/hog-functions/sub-templates/sub-templates.ts
index 13c3952f3a42..7529af59de05 100644
--- a/frontend/src/scenes/hog-functions/sub-templates/sub-templates.ts
+++ b/frontend/src/scenes/hog-functions/sub-templates/sub-templates.ts
@@ -178,9 +178,6 @@ interface HealthAlertTemplateCopy {
slackHeader: string
slackBody: string
webhookSummary: string
- emailSubject: string
- emailHtml: string
- emailText: string
discordContent: string
teamsText: string
actionButtonText: string
@@ -188,7 +185,7 @@ interface HealthAlertTemplateCopy {
descriptionVerb: string
}
-// Builds the 5 destination variants for a health-alert sub-template. The body
+// Builds the destination variants for a health-alert sub-template. The body
// strings reference only the event envelope (title/summary/link/severity/kind),
// so adding a new health-check kind requires no changes here.
function buildHealthAlertSubTemplates(
@@ -265,27 +262,6 @@ function buildHealthAlertSubTemplates(
description: `Post to a Microsoft Teams channel when a health check ${copy.descriptionVerb}`,
inputs: { text: { value: copy.teamsText } },
},
- {
- ...common,
- template_id: 'template-email',
- name: `Email when a ${copy.namePrefix}`,
- description: `Send an email when a health check ${copy.descriptionVerb}`,
- inputs: {
- email: {
- value: {
- to: { email: '', name: '' },
- from: { email: '', name: 'PostHog' },
- replyTo: '',
- cc: '',
- bcc: '',
- subject: copy.emailSubject,
- preheader: '{event.properties.summary}',
- text: copy.emailText,
- html: copy.emailHtml,
- },
- },
- },
- },
]
}
@@ -1175,11 +1151,6 @@ export const HOG_FUNCTION_SUB_TEMPLATES: Record<HogFunctionSubTemplateIdType, Ho
slackHeader: '{event.properties.title}',
slackBody: '{event.properties.summary}',
webhookSummary: '{event.properties.title}: {event.properties.summary}',
- emailSubject: 'PostHog health check: {event.properties.title}',
- emailHtml:
- '<p><strong>{event.properties.title}</strong></p><p>{event.properties.summary}</p><p>Severity: {event.properties.severity}</p><p><a href="{project.url}{event.properties.link}">View in PostHog</a></p>',
- emailText:
- '{event.properties.title}\n\n{event.properties.summary}\n\nSeverity: {event.properties.severity}\n\n{project.url}{event.properties.link}',
discordContent:
'**🩺 PostHog health check**\n\n*{event.properties.title}*\n{event.properties.summary}\n\n[View in PostHog]({project.url}{event.properties.link})',
teamsText:
@@ -1192,11 +1163,6 @@ export const HOG_FUNCTION_SUB_TEMPLATES: Record<HogFunctionSubTemplateIdType, Ho
slackHeader: 'Resolved: {event.properties.title}',
slackBody: '{event.properties.summary}',
webhookSummary: 'Resolved: {event.properties.title} — {event.properties.summary}',
- emailSubject: 'PostHog health check resolved: {event.properties.title}',
- emailHtml:
- '<p><strong>Resolved: {event.properties.title}</strong></p><p>{event.properties.summary}</p><p><a href="{project.url}{event.properties.link}">View in PostHog</a></p>',
- emailText:
- 'Resolved: {event.properties.title}\n\n{event.properties.summary}\n\n{project.url}{event.properties.link}',
discordContent:
'**✅ PostHog health check resolved**\n\n*{event.properties.title}*\n{event.properties.summary}\n\n[View in PostHog]({project.url}{event.properties.link})',
teamsText: