import { EmailTemplate } from "@jitsu-internal/webapps-shared"; import { Body, Container, Html, Preview, Section, Text } from "@react-email/components"; import React from "react"; import dayjs from "dayjs"; import utc from "dayjs/plugin/utc"; import { main } from "./styles"; import { CheckJobStatusButton, Details, Footer, MetaList } from "./shared"; import capitalize from "lodash/capitalize"; import { ConnectionStatusNotificationProps } from "../pages/api/admin/notifications"; dayjs.extend(utc); export const ConnectionStatusFlappingEmail: EmailTemplate = props => { let { name, workspaceName, entityType, entityName, entityFrom, entityTo, tableName, incidentDetails, incidentStatus, changesPerHours, flappingWindowHours, queueSize, recurringAlertsPeriodHours, detailsUrl, unsubscribeLink, } = props; if (!workspaceName?.toLowerCase().endsWith(" workspace")) { workspaceName += " workspace"; } return ( ⚠️ {capitalize(entityType)} job "{entityName}" status fluctuating between success and failure in the{" "} {workspaceName}
⚠️ Intermittent {entityType} job failures on the connection {entityName}
Hi {name || "there"}! {capitalize(entityType)} processing status changes between success and failure on the connection from{" "} {entityFrom} to {entityTo} in the {workspaceName} It has changed status {changesPerHours} times in the last {flappingWindowHours} hours.
{recurringAlertsPeriodHours && ( No additional reports will be sent for this connection in {recurringAlertsPeriodHours} hours unless the status changes. )}