From 75b04e45b81a70916db962a823ec62e345e60c17 Mon Sep 17 00:00:00 2001 From: Gwenneg Lepage Date: Tue, 24 Oct 2023 16:49:57 +0200 Subject: [PATCH] RHCLOUD-28935 Create dummy templates for OCM Service Logs (#2271) --- .../EmailTemplateMigrationService.java | 39 +++++++++++++++++++ .../severityCriticalInstantEmailBodyV2.html | 19 +++++++++ .../severityCriticalInstantEmailTitleV2.txt | 1 + .../severityDebugInstantEmailBodyV2.html | 19 +++++++++ .../severityDebugInstantEmailTitleV2.txt | 1 + .../severityErrorInstantEmailBodyV2.html | 19 +++++++++ .../severityErrorInstantEmailTitleV2.txt | 1 + .../severityFatalInstantEmailBodyV2.html | 19 +++++++++ .../severityFatalInstantEmailTitleV2.txt | 1 + .../severityInfoInstantEmailBodyV2.html | 19 +++++++++ .../severityInfoInstantEmailTitleV2.txt | 1 + .../severityMajorInstantEmailBodyV2.html | 19 +++++++++ .../severityMajorInstantEmailTitleV2.txt | 1 + .../severityWarningInstantEmailBodyV2.html | 19 +++++++++ .../severityWarningInstantEmailTitleV2.txt | 1 + 15 files changed, 179 insertions(+) create mode 100644 engine/src/main/resources/templates/OCMServiceLogs/severityCriticalInstantEmailBodyV2.html create mode 100644 engine/src/main/resources/templates/OCMServiceLogs/severityCriticalInstantEmailTitleV2.txt create mode 100644 engine/src/main/resources/templates/OCMServiceLogs/severityDebugInstantEmailBodyV2.html create mode 100644 engine/src/main/resources/templates/OCMServiceLogs/severityDebugInstantEmailTitleV2.txt create mode 100644 engine/src/main/resources/templates/OCMServiceLogs/severityErrorInstantEmailBodyV2.html create mode 100644 engine/src/main/resources/templates/OCMServiceLogs/severityErrorInstantEmailTitleV2.txt create mode 100644 engine/src/main/resources/templates/OCMServiceLogs/severityFatalInstantEmailBodyV2.html create mode 100644 engine/src/main/resources/templates/OCMServiceLogs/severityFatalInstantEmailTitleV2.txt create mode 100644 engine/src/main/resources/templates/OCMServiceLogs/severityInfoInstantEmailBodyV2.html create mode 100644 engine/src/main/resources/templates/OCMServiceLogs/severityInfoInstantEmailTitleV2.txt create mode 100644 engine/src/main/resources/templates/OCMServiceLogs/severityMajorInstantEmailBodyV2.html create mode 100644 engine/src/main/resources/templates/OCMServiceLogs/severityMajorInstantEmailTitleV2.txt create mode 100644 engine/src/main/resources/templates/OCMServiceLogs/severityWarningInstantEmailBodyV2.html create mode 100644 engine/src/main/resources/templates/OCMServiceLogs/severityWarningInstantEmailTitleV2.txt diff --git a/engine/src/main/java/com/redhat/cloud/notifications/templates/EmailTemplateMigrationService.java b/engine/src/main/java/com/redhat/cloud/notifications/templates/EmailTemplateMigrationService.java index b517d92307..5d06d0310a 100644 --- a/engine/src/main/java/com/redhat/cloud/notifications/templates/EmailTemplateMigrationService.java +++ b/engine/src/main/java/com/redhat/cloud/notifications/templates/EmailTemplateMigrationService.java @@ -275,6 +275,45 @@ public List migrate() { "MalwareDetection/detectedMalwareInstantEmailBody", "html", "Malware Detection detected malware email body" ); + /* + * Former src/main/resources/templates/OCMServiceLogs folder. + */ + createInstantEmailTemplate( + warnings, "openshift", "ocm-service-logs", List.of("severity-critical"), + "OCMServiceLogs/severityCriticalInstantEmailTitle", "txt", "OCM Service Logs critical severity email title", + "OCMServiceLogs/severityCriticalInstantEmailBody", "html", "OCM Service Logs critical severity email body" + ); + createInstantEmailTemplate( + warnings, "openshift", "ocm-service-logs", List.of("severity-debug"), + "OCMServiceLogs/severityDebugInstantEmailTitle", "txt", "OCM Service Logs debug severity email title", + "OCMServiceLogs/severityDebugInstantEmailBody", "html", "OCM Service Logs debug severity email body" + ); + createInstantEmailTemplate( + warnings, "openshift", "ocm-service-logs", List.of("severity-error"), + "OCMServiceLogs/severityErrorInstantEmailTitle", "txt", "OCM Service Logs error severity email title", + "OCMServiceLogs/severityErrorInstantEmailBody", "html", "OCM Service Logs error severity email body" + ); + createInstantEmailTemplate( + warnings, "openshift", "ocm-service-logs", List.of("severity-fatal"), + "OCMServiceLogs/severityFatalInstantEmailTitle", "txt", "OCM Service Logs fatal severity email title", + "OCMServiceLogs/severityFatalInstantEmailBody", "html", "OCM Service Logs fatal severity email body" + ); + createInstantEmailTemplate( + warnings, "openshift", "ocm-service-logs", List.of("severity-info"), + "OCMServiceLogs/severityInfoInstantEmailTitle", "txt", "OCM Service Logs info severity email title", + "OCMServiceLogs/severityInfoInstantEmailBody", "html", "OCM Service Logs info severity email body" + ); + createInstantEmailTemplate( + warnings, "openshift", "ocm-service-logs", List.of("severity-major"), + "OCMServiceLogs/severityMajorInstantEmailTitle", "txt", "OCM Service Logs major severity email title", + "OCMServiceLogs/severityMajorInstantEmailBody", "html", "OCM Service Logs major severity email body" + ); + createInstantEmailTemplate( + warnings, "openshift", "ocm-service-logs", List.of("severity-warning"), + "OCMServiceLogs/severityWarningInstantEmailTitle", "txt", "OCM Service Logs warning severity email title", + "OCMServiceLogs/severityWarningInstantEmailBody", "html", "OCM Service Logs warning severity email body" + ); + /* * Former src/main/resources/templates/Patch folder. */ diff --git a/engine/src/main/resources/templates/OCMServiceLogs/severityCriticalInstantEmailBodyV2.html b/engine/src/main/resources/templates/OCMServiceLogs/severityCriticalInstantEmailBodyV2.html new file mode 100644 index 0000000000..f3ef62da82 --- /dev/null +++ b/engine/src/main/resources/templates/OCMServiceLogs/severityCriticalInstantEmailBodyV2.html @@ -0,0 +1,19 @@ +{@boolean renderSection1=true} +{@boolean renderButtonSection1=true} +{#include Common/insightsEmailBody} +{#content-title} + OCM Service Logs - OpenShift +{/content-title} +{#content-title-section1} + Critical Severity +{/content-title-section1} +{#content-title-right-part-section1} + 1 +{/content-title-right-part-section1} +{#content-button-section1} + Go to OCM +{/content-button-section1} +{#content-body-section1} +This is a test email notification. +{/content-body-section1} +{/include} diff --git a/engine/src/main/resources/templates/OCMServiceLogs/severityCriticalInstantEmailTitleV2.txt b/engine/src/main/resources/templates/OCMServiceLogs/severityCriticalInstantEmailTitleV2.txt new file mode 100644 index 0000000000..37d859f8a4 --- /dev/null +++ b/engine/src/main/resources/templates/OCMServiceLogs/severityCriticalInstantEmailTitleV2.txt @@ -0,0 +1 @@ +Instant notification - Critical Severity - OCM Service Logs - OpenShift \ No newline at end of file diff --git a/engine/src/main/resources/templates/OCMServiceLogs/severityDebugInstantEmailBodyV2.html b/engine/src/main/resources/templates/OCMServiceLogs/severityDebugInstantEmailBodyV2.html new file mode 100644 index 0000000000..637a12b743 --- /dev/null +++ b/engine/src/main/resources/templates/OCMServiceLogs/severityDebugInstantEmailBodyV2.html @@ -0,0 +1,19 @@ +{@boolean renderSection1=true} +{@boolean renderButtonSection1=true} +{#include Common/insightsEmailBody} +{#content-title} + OCM Service Logs - OpenShift +{/content-title} +{#content-title-section1} + Debug Severity +{/content-title-section1} +{#content-title-right-part-section1} + 1 +{/content-title-right-part-section1} +{#content-button-section1} + Go to OCM +{/content-button-section1} +{#content-body-section1} +This is a test email notification. +{/content-body-section1} +{/include} diff --git a/engine/src/main/resources/templates/OCMServiceLogs/severityDebugInstantEmailTitleV2.txt b/engine/src/main/resources/templates/OCMServiceLogs/severityDebugInstantEmailTitleV2.txt new file mode 100644 index 0000000000..79551bf2fe --- /dev/null +++ b/engine/src/main/resources/templates/OCMServiceLogs/severityDebugInstantEmailTitleV2.txt @@ -0,0 +1 @@ +Instant notification - Debug Severity - OCM Service Logs - OpenShift \ No newline at end of file diff --git a/engine/src/main/resources/templates/OCMServiceLogs/severityErrorInstantEmailBodyV2.html b/engine/src/main/resources/templates/OCMServiceLogs/severityErrorInstantEmailBodyV2.html new file mode 100644 index 0000000000..077494be86 --- /dev/null +++ b/engine/src/main/resources/templates/OCMServiceLogs/severityErrorInstantEmailBodyV2.html @@ -0,0 +1,19 @@ +{@boolean renderSection1=true} +{@boolean renderButtonSection1=true} +{#include Common/insightsEmailBody} +{#content-title} + OCM Service Logs - OpenShift +{/content-title} +{#content-title-section1} + Error Severity +{/content-title-section1} +{#content-title-right-part-section1} + 1 +{/content-title-right-part-section1} +{#content-button-section1} + Go to OCM +{/content-button-section1} +{#content-body-section1} +This is a test email notification. +{/content-body-section1} +{/include} diff --git a/engine/src/main/resources/templates/OCMServiceLogs/severityErrorInstantEmailTitleV2.txt b/engine/src/main/resources/templates/OCMServiceLogs/severityErrorInstantEmailTitleV2.txt new file mode 100644 index 0000000000..f359df9434 --- /dev/null +++ b/engine/src/main/resources/templates/OCMServiceLogs/severityErrorInstantEmailTitleV2.txt @@ -0,0 +1 @@ +Instant notification - Error Severity - OCM Service Logs - OpenShift \ No newline at end of file diff --git a/engine/src/main/resources/templates/OCMServiceLogs/severityFatalInstantEmailBodyV2.html b/engine/src/main/resources/templates/OCMServiceLogs/severityFatalInstantEmailBodyV2.html new file mode 100644 index 0000000000..50d73fe831 --- /dev/null +++ b/engine/src/main/resources/templates/OCMServiceLogs/severityFatalInstantEmailBodyV2.html @@ -0,0 +1,19 @@ +{@boolean renderSection1=true} +{@boolean renderButtonSection1=true} +{#include Common/insightsEmailBody} +{#content-title} + OCM Service Logs - OpenShift +{/content-title} +{#content-title-section1} + Fatal Severity +{/content-title-section1} +{#content-title-right-part-section1} + 1 +{/content-title-right-part-section1} +{#content-button-section1} + Go to OCM +{/content-button-section1} +{#content-body-section1} +This is a test email notification. +{/content-body-section1} +{/include} diff --git a/engine/src/main/resources/templates/OCMServiceLogs/severityFatalInstantEmailTitleV2.txt b/engine/src/main/resources/templates/OCMServiceLogs/severityFatalInstantEmailTitleV2.txt new file mode 100644 index 0000000000..ccd98e5da6 --- /dev/null +++ b/engine/src/main/resources/templates/OCMServiceLogs/severityFatalInstantEmailTitleV2.txt @@ -0,0 +1 @@ +Instant notification - Fatal Severity - OCM Service Logs - OpenShift \ No newline at end of file diff --git a/engine/src/main/resources/templates/OCMServiceLogs/severityInfoInstantEmailBodyV2.html b/engine/src/main/resources/templates/OCMServiceLogs/severityInfoInstantEmailBodyV2.html new file mode 100644 index 0000000000..35b1f92fbc --- /dev/null +++ b/engine/src/main/resources/templates/OCMServiceLogs/severityInfoInstantEmailBodyV2.html @@ -0,0 +1,19 @@ +{@boolean renderSection1=true} +{@boolean renderButtonSection1=true} +{#include Common/insightsEmailBody} +{#content-title} + OCM Service Logs - OpenShift +{/content-title} +{#content-title-section1} + Info Severity +{/content-title-section1} +{#content-title-right-part-section1} + 1 +{/content-title-right-part-section1} +{#content-button-section1} + Go to OCM +{/content-button-section1} +{#content-body-section1} +This is a test email notification. +{/content-body-section1} +{/include} diff --git a/engine/src/main/resources/templates/OCMServiceLogs/severityInfoInstantEmailTitleV2.txt b/engine/src/main/resources/templates/OCMServiceLogs/severityInfoInstantEmailTitleV2.txt new file mode 100644 index 0000000000..30f44d9a7f --- /dev/null +++ b/engine/src/main/resources/templates/OCMServiceLogs/severityInfoInstantEmailTitleV2.txt @@ -0,0 +1 @@ +Instant notification - Info Severity - OCM Service Logs - OpenShift \ No newline at end of file diff --git a/engine/src/main/resources/templates/OCMServiceLogs/severityMajorInstantEmailBodyV2.html b/engine/src/main/resources/templates/OCMServiceLogs/severityMajorInstantEmailBodyV2.html new file mode 100644 index 0000000000..79803b31c9 --- /dev/null +++ b/engine/src/main/resources/templates/OCMServiceLogs/severityMajorInstantEmailBodyV2.html @@ -0,0 +1,19 @@ +{@boolean renderSection1=true} +{@boolean renderButtonSection1=true} +{#include Common/insightsEmailBody} +{#content-title} + OCM Service Logs - OpenShift +{/content-title} +{#content-title-section1} + Major Severity +{/content-title-section1} +{#content-title-right-part-section1} + 1 +{/content-title-right-part-section1} +{#content-button-section1} + Go to OCM +{/content-button-section1} +{#content-body-section1} +This is a test email notification. +{/content-body-section1} +{/include} diff --git a/engine/src/main/resources/templates/OCMServiceLogs/severityMajorInstantEmailTitleV2.txt b/engine/src/main/resources/templates/OCMServiceLogs/severityMajorInstantEmailTitleV2.txt new file mode 100644 index 0000000000..fb76b3b5c0 --- /dev/null +++ b/engine/src/main/resources/templates/OCMServiceLogs/severityMajorInstantEmailTitleV2.txt @@ -0,0 +1 @@ +Instant notification - Major Severity - OCM Service Logs - OpenShift \ No newline at end of file diff --git a/engine/src/main/resources/templates/OCMServiceLogs/severityWarningInstantEmailBodyV2.html b/engine/src/main/resources/templates/OCMServiceLogs/severityWarningInstantEmailBodyV2.html new file mode 100644 index 0000000000..b3a650b889 --- /dev/null +++ b/engine/src/main/resources/templates/OCMServiceLogs/severityWarningInstantEmailBodyV2.html @@ -0,0 +1,19 @@ +{@boolean renderSection1=true} +{@boolean renderButtonSection1=true} +{#include Common/insightsEmailBody} +{#content-title} + OCM Service Logs - OpenShift +{/content-title} +{#content-title-section1} + Warning Severity +{/content-title-section1} +{#content-title-right-part-section1} + 1 +{/content-title-right-part-section1} +{#content-button-section1} + Go to OCM +{/content-button-section1} +{#content-body-section1} +This is a test email notification. +{/content-body-section1} +{/include} diff --git a/engine/src/main/resources/templates/OCMServiceLogs/severityWarningInstantEmailTitleV2.txt b/engine/src/main/resources/templates/OCMServiceLogs/severityWarningInstantEmailTitleV2.txt new file mode 100644 index 0000000000..ef7ea0bb8e --- /dev/null +++ b/engine/src/main/resources/templates/OCMServiceLogs/severityWarningInstantEmailTitleV2.txt @@ -0,0 +1 @@ +Instant notification - Warning Severity - OCM Service Logs - OpenShift \ No newline at end of file