Skip to content

Commit

Permalink
Overriding defaultTitle with subject for SNS notifications (#708)
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)
  • Loading branch information
uroskarama authored and github-actions[bot] committed Dec 21, 2022
1 parent 34076ba commit bab9c4d
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 bab9c4d

Please sign in to comment.