From faea1357a7d764f2774b3c7f58539d24921a24dc Mon Sep 17 00:00:00 2001 From: Chris Berry Date: Mon, 18 Sep 2017 20:35:14 -0700 Subject: [PATCH] fix(email): include markdown converter in email notification agent call (#172) --- .../EmailNotificationAgent.groovy | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/echo-notifications/src/main/groovy/com/netflix/spinnaker/echo/notification/EmailNotificationAgent.groovy b/echo-notifications/src/main/groovy/com/netflix/spinnaker/echo/notification/EmailNotificationAgent.groovy index 75150e313..4ea42174f 100644 --- a/echo-notifications/src/main/groovy/com/netflix/spinnaker/echo/notification/EmailNotificationAgent.groovy +++ b/echo-notifications/src/main/groovy/com/netflix/spinnaker/echo/notification/EmailNotificationAgent.groovy @@ -16,6 +16,8 @@ package com.netflix.spinnaker.echo.notification +import com.netflix.spinnaker.echo.notification.NotificationTemplateEngine.HtmlToPlainTextFormatter +import com.netflix.spinnaker.echo.notification.NotificationTemplateEngine.MarkdownToHtmlFormatter import groovy.util.logging.Slf4j import com.netflix.spinnaker.echo.email.EmailNotificationService import com.netflix.spinnaker.echo.model.Event @@ -97,15 +99,17 @@ class EmailNotificationAgent extends AbstractEventNotificationAgent { def body = FreeMarkerTemplateUtils.processTemplateIntoString( template, [ - event : prettyPrint(toJson(event.content)), - url : spinnakerUrl, - application: event.details?.application, - executionId: event.content?.execution?.id, - type : type, - status : status, - link : link, - name : event.content?.execution?.name ?: event.content?.execution?.description, - message : customMessage + event : prettyPrint(toJson(event.content)), + url : spinnakerUrl, + htmlToText : new HtmlToPlainTextFormatter(), + markdownToHtml : new MarkdownToHtmlFormatter(), + application : event.details?.application, + executionId : event.content?.execution?.id, + type : type, + status : status, + link : link, + name : event.content?.execution?.name ?: event.content?.execution?.description, + message : customMessage ] )