Skip to content

Commit

Permalink
Overriding defaultTitle with subject for SNS notifications (#708) (#723)
Browse files Browse the repository at this point in the history
* Overriding defaultTitle with subject for SNS notifications

Signed-off-by: uros <[email protected]>

* Overriding defaultTitle with subject for SNS notifications - condition fix

Signed-off-by: uros <[email protected]>

Signed-off-by: uros <[email protected]>
(cherry picked from commit 88536b2)

Co-authored-by: uroskarama <[email protected]>
  • Loading branch information
opensearch-trigger-bot[bot] and uroskarama authored Jan 9, 2023
1 parent dc20ba1 commit 3d146d0
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.SNS) {
return if (subject.isNullOrEmpty()) defaultTitle else subject
}

Expand Down

0 comments on commit 3d146d0

Please sign in to comment.