Skip to content

Commit

Permalink
Added support for hmtl format
Browse files Browse the repository at this point in the history
Signed-off-by: danielkyalo599 <[email protected]>
  • Loading branch information
dankyalo599 committed Feb 13, 2023
1 parent 5fbb292 commit e2a4e4f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
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"
}
}
}

This file was deleted.

0 comments on commit e2a4e4f

Please sign in to comment.