Skip to content

Commit

Permalink
Fix email formatting a bit.
Browse files Browse the repository at this point in the history
  • Loading branch information
jannistsiroyannis committed Nov 10, 2023
1 parent 3afcaf1 commit 161dae2
Showing 1 changed file with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -227,19 +227,23 @@ class NotificationSender extends HouseKeeper {
else
sb.append("\n")

Object comments = Document._get(["@graph", 1, "comment"], observation)

if (comments instanceof List) {
sb.append("\n\tTillhörande kommentarer:")
for (String comment : comments)
sb.append("\n\t\t"+comment)
}

boolean commentsRendered = false
for (Map observation : triggeredObservations) {
String observationUri = Document._get(["@graph", 1, "@id"], observation)
if (!observationUri)
continue

if (!commentsRendered) {
commentsRendered = true
Object comments = Document._get(["@graph", 1, "comment"], observation)

if (comments instanceof List) {
sb.append("\n\tTillhörande kommentarer:")
for (String comment : comments)
sb.append("\n\t\t" + comment + "\n\n")
}
}

String observationId = whelk.getStorage().getSystemIdByIri(observationUri)
Document embellishedObservation = whelk.loadEmbellished(observationId)
Map framed = JsonLd.frame(observationUri, embellishedObservation.data)
Expand Down

0 comments on commit 161dae2

Please sign in to comment.