mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 06:28:11 +00:00
Improve PKI alert email layout
This commit is contained in:
@@ -464,7 +464,7 @@ export const pkiAlertV2ServiceFactory = ({
|
|||||||
|
|
||||||
return smtpService.sendMail({
|
return smtpService.sendMail({
|
||||||
recipients: config.recipients,
|
recipients: config.recipients,
|
||||||
subjectLine: `Infisical PKI Alert: ${alertName}`,
|
subjectLine: `Infisical Certificate Alert - ${alertName}`,
|
||||||
substitutions: {
|
substitutions: {
|
||||||
alertName,
|
alertName,
|
||||||
alertBeforeDays,
|
alertBeforeDays,
|
||||||
|
|||||||
@@ -29,32 +29,23 @@ export const PkiExpirationAlertTemplate = ({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const daysText = alertBeforeDays === 1 ? "1 day" : `${alertBeforeDays} days`;
|
|
||||||
const certificateText = items.length === 1 ? "certificate" : "certificates";
|
const certificateText = items.length === 1 ? "certificate" : "certificates";
|
||||||
|
const daysText = alertBeforeDays === 1 ? "1 day" : `${alertBeforeDays} days`;
|
||||||
|
|
||||||
|
const message = `Alert ${alertName}: You have ${items.length === 1 ? "one" : items.length} ${certificateText} that will expire in ${daysText}.`;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<BaseEmailWrapper
|
<BaseEmailWrapper title="Certificate Expiration Notice" preview={message} siteUrl={siteUrl}>
|
||||||
title="Certificate Expiration Notice"
|
|
||||||
preview={`${items.length} ${certificateText} expiring in ${daysText}`}
|
|
||||||
siteUrl={siteUrl}
|
|
||||||
>
|
|
||||||
<Heading className="text-black text-[18px] leading-[28px] text-center font-normal p-0 mx-0">
|
<Heading className="text-black text-[18px] leading-[28px] text-center font-normal p-0 mx-0">
|
||||||
<strong>Certificate expiration notice</strong>
|
<strong>Certificate Expiration Notice</strong>
|
||||||
</Heading>
|
</Heading>
|
||||||
|
|
||||||
<Section className="px-[24px] mb-[28px] mt-[36px] pt-[12px] pb-[8px] border border-solid border-gray-200 rounded-md bg-gray-50">
|
<Section className="px-[24px] mb-[28px] mt-[36px] pt-[12px] pb-[8px] border border-solid border-gray-200 rounded-md bg-gray-50">
|
||||||
<Text className="text-[14px]">
|
<Text className="text-[14px]">
|
||||||
You have{" "}
|
Alert <strong className="font-semibold">{alertName}</strong>: You have{" "}
|
||||||
<strong>
|
{items.length === 1 ? "one" : items.length} {certificateText} that will expire in {daysText}.
|
||||||
{items.length} {certificateText}
|
|
||||||
</strong>{" "}
|
|
||||||
expiring in {daysText}.
|
|
||||||
</Text>
|
|
||||||
<Text className="text-[14px]">
|
|
||||||
Alert: <strong>{alertName}</strong>
|
|
||||||
</Text>
|
</Text>
|
||||||
</Section>
|
</Section>
|
||||||
|
|
||||||
<Section className="mb-[28px]">
|
<Section className="mb-[28px]">
|
||||||
<Text className="text-[14px] font-semibold mb-[12px]">Expiring certificates:</Text>
|
<Text className="text-[14px] font-semibold mb-[12px]">Expiring certificates:</Text>
|
||||||
{items.map((item) => (
|
{items.map((item) => (
|
||||||
|
|||||||
Reference in New Issue
Block a user