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

Feature alerting mail support html format #586 #614

Closed
Show file tree
Hide file tree
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 @@ -153,7 +153,7 @@ jobs:
uses: actions/cache@v2
with:
path: ${{ matrix.cypress_cache_folder }}
key: cypress-cache-v2-${{ runner.os }}-${{ hashFiles('**/package.json') }}
key: cypress-cache-v2-${{ runner.os }}-${{ hashFiles('OpenSearch-Dashboards/plugins/dashboards-notifications/package.json') }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this needed?


- name: Reset npm's script shell
if: ${{ matrix.os == 'windows-latest' }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,16 @@ class MessageContent(

init {
require(!Strings.isNullOrEmpty(title)) { "title is null or empty" }
require(!Strings.isNullOrEmpty(textDescription)) { "text message part is null or empty" }
require(!Strings.isNullOrEmpty(textDescription) || !Strings.isNullOrEmpty(htmlDescription)) {
"text message part and html message part are both null or empty"
}
}

fun buildMessageWithTitle(): String {
return "$title\n\n$textDescription"
return if (htmlDescription != null) {
htmlDescription
} else {
"$title\n\n$textDescription"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ package org.opensearch.notifications.spi.model.destination
* Supported notification destinations
*/
enum class DestinationType {
CHIME, SLACK, CUSTOM_WEBHOOK, SMTP, SES, SNS
CHIME, SLACK, CUSTOM_WEBHOOK, SMTP, SES, SNS, TELEGRAM
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove telegram from this PR as its part of another pr

}