From 525fd3fc2e2309174e02f8e9b447a6abc9cd59d0 Mon Sep 17 00:00:00 2001 From: automike Date: Wed, 6 Mar 2019 01:11:28 -0800 Subject: [PATCH] Nexial v2.0 Release Candidate Signed-off-by: automike --- src/main/kotlin/org/nexial/core/model/EventNotification.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/org/nexial/core/model/EventNotification.kt b/src/main/kotlin/org/nexial/core/model/EventNotification.kt index c42635890..6ea898332 100644 --- a/src/main/kotlin/org/nexial/core/model/EventNotification.kt +++ b/src/main/kotlin/org/nexial/core/model/EventNotification.kt @@ -72,8 +72,7 @@ class EmailNotification(context: ExecutionContext, event: ExecutionEvent, data: return } - val content = OutputFileUtils.resolveContent( - StringUtils.trim(StringUtils.substringAfterLast(data, EVENT_CONFIG_SEP)), context, false) + val content = StringUtils.substringAfter(data, EVENT_CONFIG_SEP) if (StringUtils.isBlank(content)) { logSkipping("no content to sent") return @@ -96,11 +95,13 @@ class EmailNotification(context: ExecutionContext, event: ExecutionEvent, data: "from" -> mailData.fromAddr = value "html" -> mailData.mimeType = if (BooleanUtils.toBoolean(value)) MIME_HTML else MIME_PLAIN "footer" -> mailData.isFooter = BooleanUtils.toBoolean(value.toLowerCase()) - "body" -> body = OutputFileUtils.resolveContent(StringUtils.trim(value), context, false) + "body" -> body = StringUtils.trim(value) else -> ConsoleUtils.error("Unknown configuration for email notification: $key") } } + if (StringUtils.isNotEmpty(body)) body = OutputFileUtils.resolveContent(StringUtils.trim(body), context, false) + return mailData.setToAddr(recipientList).setSubject(subject).setContent(body) }