Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overriding defaultTitle with subject for SNS notifications #708

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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