mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-17 10:45:58 +00:00
alerting for gateways and relays
This commit is contained in:
@@ -15,7 +15,9 @@ export enum NotificationType {
|
||||
DIRECT_PROJECT_ACCESS_ISSUED_TO_ADMIN = "direct-project-access-issued-to-admin",
|
||||
PROJECT_ACCESS_REQUEST = "project-access-request",
|
||||
PROJECT_INVITATION = "project-invitation",
|
||||
SECRET_SYNC_FAILED = "secret-sync-failed"
|
||||
SECRET_SYNC_FAILED = "secret-sync-failed",
|
||||
GATEWAY_HEALTH_ALERT = "gateway-health-alert",
|
||||
RELAY_HEALTH_ALERT = "relay-health-alert"
|
||||
}
|
||||
|
||||
export interface TCreateUserNotificationDTO {
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
import { Heading, Section, Text } from "@react-email/components";
|
||||
|
||||
import { BaseEmailWrapper, BaseEmailWrapperProps } from "./BaseEmailWrapper";
|
||||
import { BaseLink } from "./BaseLink";
|
||||
|
||||
interface HealthAlertTemplateProps extends Omit<BaseEmailWrapperProps, "title" | "preview" | "children"> {
|
||||
type: "gateway" | "relay";
|
||||
names: string;
|
||||
}
|
||||
|
||||
export const HealthAlertTemplate = ({ siteUrl, names, type }: HealthAlertTemplateProps) => {
|
||||
return (
|
||||
<BaseEmailWrapper
|
||||
title={`${type === "gateway" ? "Gateway" : "Relay"} Health Alert`}
|
||||
preview={`Some ${type}s in your organization have failed their health check.`}
|
||||
siteUrl={siteUrl}
|
||||
>
|
||||
<Heading className="text-black text-[18px] leading-[28px] text-center font-normal p-0 mx-0">
|
||||
{type === "gateway" ? "Gateway" : "Relay"} Health Alert
|
||||
</Heading>
|
||||
<Section className="px-[24px] mt-[36px] pt-[12px] pb-[8px] border border-solid border-gray-200 rounded-md bg-gray-50">
|
||||
<Text className="text-black text-[14px] leading-[24px]">
|
||||
The following <strong>{type}</strong>(s) in your organization may be offline as they haven't reported a
|
||||
heartbeat in over an hour: <strong>{names}</strong>.
|
||||
</Text>
|
||||
<Text className="text-black text-[14px] leading-[24px]">
|
||||
If your issue persists, you can contact the Infisical team at{" "}
|
||||
<BaseLink href="mailto:[email protected]">[email protected]</BaseLink>.
|
||||
</Text>
|
||||
</Section>
|
||||
</BaseEmailWrapper>
|
||||
);
|
||||
};
|
||||
|
||||
export default HealthAlertTemplate;
|
||||
|
||||
HealthAlertTemplate.PreviewProps = {
|
||||
type: "gateway",
|
||||
names: '"gateway1", "gateway2"',
|
||||
siteUrl: "https://infisical.com"
|
||||
} as HealthAlertTemplateProps;
|
||||
@@ -6,6 +6,7 @@ export * from "./EmailVerificationTemplate";
|
||||
export * from "./ExternalImportFailedTemplate";
|
||||
export * from "./ExternalImportStartedTemplate";
|
||||
export * from "./ExternalImportSucceededTemplate";
|
||||
export * from "./HealthAlertTemplate";
|
||||
export * from "./IntegrationSyncFailedTemplate";
|
||||
export * from "./NewDeviceLoginTemplate";
|
||||
export * from "./OAuthPasswordResetTemplate";
|
||||
|
||||
@@ -15,6 +15,7 @@ import {
|
||||
ExternalImportFailedTemplate,
|
||||
ExternalImportStartedTemplate,
|
||||
ExternalImportSucceededTemplate,
|
||||
HealthAlertTemplate,
|
||||
IntegrationSyncFailedTemplate,
|
||||
NewDeviceLoginTemplate,
|
||||
OAuthPasswordResetTemplate,
|
||||
@@ -85,7 +86,8 @@ export enum SmtpTemplates {
|
||||
ServiceTokenExpired = "serviceTokenExpired",
|
||||
SecretScanningV2ScanFailed = "secretScanningV2ScanFailed",
|
||||
SecretScanningV2SecretsDetected = "secretScanningV2SecretsDetected",
|
||||
AccountDeletionConfirmation = "accountDeletionConfirmation"
|
||||
AccountDeletionConfirmation = "accountDeletionConfirmation",
|
||||
HealthAlert = "healthAlert"
|
||||
}
|
||||
|
||||
export enum SmtpHost {
|
||||
@@ -131,7 +133,8 @@ const EmailTemplateMap: Record<SmtpTemplates, React.FC<any>> = {
|
||||
[SmtpTemplates.PkiExpirationAlert]: PkiExpirationAlertTemplate,
|
||||
[SmtpTemplates.SecretScanningV2ScanFailed]: SecretScanningScanFailedTemplate,
|
||||
[SmtpTemplates.SecretScanningV2SecretsDetected]: SecretScanningSecretsDetectedTemplate,
|
||||
[SmtpTemplates.AccountDeletionConfirmation]: AccountDeletionConfirmationTemplate
|
||||
[SmtpTemplates.AccountDeletionConfirmation]: AccountDeletionConfirmationTemplate,
|
||||
[SmtpTemplates.HealthAlert]: HealthAlertTemplate
|
||||
};
|
||||
|
||||
export const smtpServiceFactory = (cfg: TSmtpConfig) => {
|
||||
|
||||
Reference in New Issue
Block a user