Skip to content

Commit 3e0881c

Browse files
committed
Added project name to run alert email
1 parent ec3c300 commit 3e0881c

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

packages/emails/emails/alert-run-failure.tsx

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import React from "react";
1818
export const AlertRunEmailSchema = z.object({
1919
email: z.literal("alert-run"),
2020
runId: z.string(),
21+
project: z.string(),
2122
taskIdentifier: z.string(),
2223
fileName: z.string(),
2324
exportName: z.string(),
@@ -31,8 +32,11 @@ export const AlertRunEmailSchema = z.object({
3132
runLink: z.string().url(),
3233
});
3334

34-
const previewDefaults = {
35+
type AlertRunEmailProps = z.infer<typeof AlertRunEmailSchema>;
36+
37+
const previewDefaults: AlertRunEmailProps = {
3538
runId: "run_12345678",
39+
project: "my-project",
3640
taskIdentifier: "my-task",
3741
fileName: "other.ts",
3842
exportName: "myTask",
@@ -46,8 +50,18 @@ const previewDefaults = {
4650
runLink: "https://trigger.dev",
4751
};
4852

49-
export default function Email(props: z.infer<typeof AlertRunEmailSchema>) {
50-
const { runId, taskIdentifier, fileName, exportName, version, environment, error, runLink } = {
53+
export default function Email(props: AlertRunEmailProps) {
54+
const {
55+
runId,
56+
project,
57+
taskIdentifier,
58+
fileName,
59+
exportName,
60+
version,
61+
environment,
62+
error,
63+
runLink,
64+
} = {
5165
...previewDefaults,
5266
...props,
5367
};
@@ -59,6 +73,7 @@ export default function Email(props: z.infer<typeof AlertRunEmailSchema>) {
5973
<Body style={main}>
6074
<Container style={container}>
6175
<Text style={h1}>Run `{runId}` failed</Text>
76+
<Text style={paragraphTight}>Project: {project}</Text>
6277
<Text style={paragraphTight}>Task ID: {taskIdentifier}</Text>
6378
<Text style={paragraphTight}>Filename: {fileName}</Text>
6479
<Text style={paragraphTight}>Function: {exportName}()</Text>

0 commit comments

Comments
 (0)