: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(support): offer email fallback when support ticket submission fails (#73281)
Luke Beltonfba818b6b4b6
diff --git a/frontend/src/lib/components/Support/supportLogic.ts b/frontend/src/lib/components/Support/supportLogic.tsindex 1e11fa024006..7546ef5468ba 100644--- a/frontend/src/lib/components/Support/supportLogic.ts+++ b/frontend/src/lib/components/Support/supportLogic.ts@@ -7,7 +7,7 @@ import { LemonSelectOptions } from '@posthog/lemon-ui'import api from 'lib/api'import { FEATURE_FLAGS } from 'lib/constants'-import { lemonToast } from 'lib/lemon-ui/LemonToast/LemonToast'+import { EMAIL_SUPPORT_BUTTON, lemonToast } from 'lib/lemon-ui/LemonToast/LemonToast'import { featureFlagLogic } from 'lib/logic/featureFlagLogic'import { preflightLogic } from 'lib/logic/preflightLogic'import { uuid } from 'lib/utils/dom'@@ -854,7 +854,7 @@ export const supportLogic = kea<supportLogicType>([current_url_length: window.location.href.length,})lemonToast.error("Oops, the message couldn't be sent. Please try again in a moment.", {- hideButton: true,+ button: EMAIL_SUPPORT_BUTTON,})return}@@ -1077,7 +1077,7 @@ export const supportLogic = kea<supportLogicType>([})lemonToast.error(`Oops, the message couldn't be sent. Please change your browser's privacy level to the standard or default level, then try again. (E.g. In Firefox: Settings > Privacy & Security > Standard)`,- { hideButton: true }+ { button: EMAIL_SUPPORT_BUTTON })// Don't close the form or reset the data so user can try againreturn@@ -1119,7 +1119,7 @@ export const supportLogic = kea<supportLogicType>([// Use the same error message regardless of browserlemonToast.error(`Oops, the message couldn't be sent. Please change your browser's privacy level to the standard or default level, then try again. (E.g. In Firefox: Settings > Privacy & Security > Standard)`,- { hideButton: true }+ { button: EMAIL_SUPPORT_BUTTON })// Don't close the form or reset the data so user can try again}diff --git a/frontend/src/lib/lemon-ui/LemonToast/LemonToast.tsx b/frontend/src/lib/lemon-ui/LemonToast/LemonToast.tsxindex 2a483305b667..b13c78f926da 100644--- a/frontend/src/lib/lemon-ui/LemonToast/LemonToast.tsx+++ b/frontend/src/lib/lemon-ui/LemonToast/LemonToast.tsx@@ -43,6 +43,15 @@ export const GET_HELP_BUTTON: ToastButton = {},}+// Fallback for when submitting a support ticket in-app fails: let the user reach us+// directly by email instead of being sent back to the form that just failed.+export const EMAIL_SUPPORT_BUTTON: ToastButton = {+ label: 'Email us directly',+ action: () => {+ window.location.href = 'mailto:[email protected]?subject=PostHog support request'+ },+}+export interface ToastContentProps {type: 'info' | 'success' | 'warning' | 'error'message: string | JSX.Elementdiff --git a/products/conversations/frontend/components/SidePanel/sidepanelTicketsLogic.ts b/products/conversations/frontend/components/SidePanel/sidepanelTicketsLogic.tsindex 96fe3a32d394..5173b260a952 100644--- a/products/conversations/frontend/components/SidePanel/sidepanelTicketsLogic.ts+++ b/products/conversations/frontend/components/SidePanel/sidepanelTicketsLogic.ts@@ -17,7 +17,7 @@ import posthog from 'posthog-js'import { appendExceptionToMessage, supportLogic, warnIfMessageTooLong } from 'lib/components/Support/supportLogic'import { FEATURE_FLAGS } from 'lib/constants'-import { lemonToast } from 'lib/lemon-ui/LemonToast/LemonToast'+import { EMAIL_SUPPORT_BUTTON, lemonToast } from 'lib/lemon-ui/LemonToast/LemonToast'import { featureFlagLogic } from 'lib/logic/featureFlagLogic'import { sidePanelStateLogic } from '~/layout/navigation-3000/sidepanel/sidePanelStateLogic'@@ -476,7 +476,7 @@ export const sidepanelTicketsLogic = kea<sidepanelTicketsLogicType>([current_url_length: window.location.href.length,is_new_ticket: values.view === 'new',})- lemonToast.error('Failed to send message. Please try again.')+ lemonToast.error('Failed to send message. Please try again.', { button: EMAIL_SUPPORT_BUTTON })} finally {actions.setMessageSending(false)}