Skip to content

Commit

Permalink
feat(email/slack): allow custom messages per notification (#241)
Browse files Browse the repository at this point in the history
  • Loading branch information
anotherchrisberry committed Mar 9, 2018
1 parent bd3965e commit f92a9ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class EmailNotificationAgent extends AbstractEventNotificationAgent {
status == 'complete' ? 'completed successfully' : status
}"""

subject = context.customSubject ?: subject
subject = preference.customSubject ?: context.customSubject ?: subject

log.info('Sending email {} for {} {} {} {}', kv('address', preference.address), kv('application', application), kv('type', config.type), kv('status', status), kv('executionId', event.content?.execution?.id))

Expand All @@ -88,7 +88,7 @@ class EmailNotificationAgent extends AbstractEventNotificationAgent {
status,
config.link,
preference.message?."$config.type.$status"?.text,
context.customBody
preference.customBody ?: context.customBody
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class SlackNotificationAgent extends AbstractEventNotificationAgent {
body += "\n\n" + preference.message."$config.type.$status".text
}

String customMessage = event.content?.context?.customMessage
String customMessage = preference.customMessage ?: event.content?.context?.customMessage
if (customMessage) {
body = customMessage
.replace("{{executionId}}", (String) event.content.execution?.id ?: "")
Expand Down

0 comments on commit f92a9ca

Please sign in to comment.