Skip to content

Commit

Permalink
Overriding defaultTitle with subject for SNS notifications
Browse files Browse the repository at this point in the history
Signed-off-by: uros <[email protected]>
  • Loading branch information
uroskarama committed Dec 20, 2022
1 parent 817d9ef commit b7aab3b
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.EMAIL) {
return if (subject.isNullOrEmpty()) defaultTitle else subject
}

Expand Down

0 comments on commit b7aab3b

Please sign in to comment.