-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1896 from dubinc/webhook-disable
Refactor webhook failure handling and notifications
- Loading branch information
Showing
6 changed files
with
150 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -137,6 +137,7 @@ export const PATCH = withWorkspace( | |
})), | ||
}, | ||
}), | ||
disabledAt: null, | ||
}, | ||
select: { | ||
id: true, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import { DUB_WORDMARK } from "@dub/utils"; | ||
import { | ||
Body, | ||
Container, | ||
Head, | ||
Heading, | ||
Html, | ||
Img, | ||
Link, | ||
Preview, | ||
Section, | ||
Tailwind, | ||
Text, | ||
} from "@react-email/components"; | ||
import Footer from "./components/footer"; | ||
|
||
export default function WebhookFailed({ | ||
email = "[email protected]", | ||
workspace = { | ||
name: "Acme, Inc", | ||
slug: "acme", | ||
}, | ||
webhook = { | ||
id: "wh_tYedrqsWgNJxUwQOaAnupcUJ1", | ||
url: "https://example.com/webhook", | ||
}, | ||
}: { | ||
email: string; | ||
workspace: { | ||
name: string; | ||
slug: string; | ||
}; | ||
webhook: { | ||
id: string; | ||
url: string; | ||
}; | ||
}) { | ||
return ( | ||
<Html> | ||
<Head /> | ||
<Preview>Webhook is failing to deliver</Preview> | ||
<Tailwind> | ||
<Body className="mx-auto my-auto bg-white font-sans"> | ||
<Container className="mx-auto my-10 max-w-[500px] rounded border border-solid border-gray-200 px-10 py-5"> | ||
<Section className="mt-8"> | ||
<Img | ||
src={DUB_WORDMARK} | ||
height="40" | ||
alt="Dub.co" | ||
className="mx-auto my-0" | ||
/> | ||
</Section> | ||
<Heading className="mx-0 my-7 p-0 text-center text-xl font-semibold text-black"> | ||
Webhook is failing to deliver | ||
</Heading> | ||
<Text className="text-sm leading-6 text-black"> | ||
Your webhook <strong>{webhook.url}</strong> is encountering | ||
delivery failures and will be disabled if it continues to fail. | ||
</Text> | ||
<Text className="text-sm leading-6 text-black"> | ||
Please review the webhook details and update the URL if necessary | ||
to restore functionality. | ||
</Text> | ||
<Section className="mb-8 mt-4 text-center"> | ||
<Link | ||
className="rounded-full bg-black px-6 py-3 text-center text-[12px] font-semibold text-white no-underline" | ||
href={`https://app.dub.co/${workspace.slug}/settings/webhooks/${webhook.id}/edit`} | ||
> | ||
Edit Webhook | ||
</Link> | ||
</Section> | ||
<Footer email={email} /> | ||
</Container> | ||
</Body> | ||
</Tailwind> | ||
</Html> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters