diff --git a/apps/roam/src/utils/sendErrorEmail.ts b/apps/roam/src/utils/sendErrorEmail.ts index 2dfffe211..578559cfd 100644 --- a/apps/roam/src/utils/sendErrorEmail.ts +++ b/apps/roam/src/utils/sendErrorEmail.ts @@ -1,5 +1,6 @@ import { getNodeEnv } from "roamjs-components/util/env"; import { ErrorEmailProps } from "@repo/types"; +import { getVersionWithDate } from "~/utils/getVersion"; const sendErrorEmail = async ({ error, @@ -14,12 +15,15 @@ const sendErrorEmail = async ({ getNodeEnv() === "development" ? "http://localhost:3000/api/errors" : "https://discoursegraphs.com/api/errors"; + const { version, buildDate } = getVersionWithDate(); const payload: ErrorEmailProps = { errorMessage: error.message, errorStack: error.stack || "", type, app: "Roam", graphName: window.roamAlphaAPI?.graph?.name || "unknown", + version, + buildDate, context, }; diff --git a/apps/website/app/api/errors/EmailTemplate.tsx b/apps/website/app/api/errors/EmailTemplate.tsx index 853becf98..5e4492272 100644 --- a/apps/website/app/api/errors/EmailTemplate.tsx +++ b/apps/website/app/api/errors/EmailTemplate.tsx @@ -8,15 +8,19 @@ export const EmailTemplate = ({ type, app, graphName, + version, + buildDate, context, }: ErrorEmailProps) => { return (

Error Report

-

Type: {type}

-

App: {app}

-

Graph Name: {graphName}

+ Type: {type} + App: {app} + Graph Name: {graphName} + {version && Version: {version}} + {buildDate && Build Date: {buildDate}}

Error Details

diff --git a/packages/types/index.ts b/packages/types/index.ts index e8e1e3f38..356ef918c 100644 --- a/packages/types/index.ts +++ b/packages/types/index.ts @@ -4,5 +4,7 @@ export type ErrorEmailProps = { type: string; // To identify the type of error, eg "Export Dialog Failed" app: "Roam" | "Obsidian"; graphName: string; + version?: string; + buildDate?: string; context?: Record; };