From b7aab3bfde04aa88e2714eebda9cd925bc56780b Mon Sep 17 00:00:00 2001 From: uros Date: Tue, 20 Dec 2022 17:17:59 +0100 Subject: [PATCH] Overriding defaultTitle with subject for SNS notifications Signed-off-by: uros --- .../util/destinationmigration/NotificationApiUtils.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/util/destinationmigration/NotificationApiUtils.kt b/alerting/src/main/kotlin/org/opensearch/alerting/util/destinationmigration/NotificationApiUtils.kt index cd44a7887..a0232c016 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/util/destinationmigration/NotificationApiUtils.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/util/destinationmigration/NotificationApiUtils.kt @@ -138,12 +138,12 @@ suspend fun NotificationConfigInfo.sendNotification(client: Client, title: Strin } /** - * For most channel types, a placeholder Alerting title will be used but the email channel will - * use the subject, so it appears as the actual subject of the email. + * For most channel types, a placeholder Alerting title will be used but the email channel/SNS notification will + * use the subject, so it appears as the actual subject of the email/SNS notification. */ fun NotificationConfigInfo.getTitle(subject: String?): String { val defaultTitle = "Alerting-Notification Action" - if (this.notificationConfig.configType == ConfigType.EMAIL) { + if (this.notificationConfig.configType == ConfigType.EMAIL || this.notificationConfig.configType == ConfigType.EMAIL) { return if (subject.isNullOrEmpty()) defaultTitle else subject }