From a456cceb195b5f15ed161b7337d02ff8656ae59b Mon Sep 17 00:00:00 2001
From: Ludovic Poitou <ludovic.poitou@gmail.com>
Date: Thu, 19 Nov 2015 21:06:37 +0000
Subject: [PATCH] Adding support for sending Notifications as html instead of plaintext.
---
opendj-server-legacy/src/main/java/org/opends/server/util/EMailMessage.java | 22 +++++++++++++++++++++-
1 files changed, 21 insertions(+), 1 deletions(-)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/util/EMailMessage.java b/opendj-server-legacy/src/main/java/org/opends/server/util/EMailMessage.java
index d80be4c..8436dd1 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/util/EMailMessage.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/util/EMailMessage.java
@@ -24,6 +24,7 @@
*
* Copyright 2006-2008 Sun Microsystems, Inc.
* Portions Copyright 2014-2015 ForgeRock AS
+ * Portions copyright 2015 Edan Idzerda
*/
package org.opends.server.util;
@@ -228,6 +229,25 @@
}
+ /**
+ * Retrieves the MIME Type for the body of this message
+ *
+ * @return The MIME Type for this message
+ */
+ public String getBodyMIMEType()
+ {
+ return bodyMIMEType;
+ }
+
+ /**
+ * Specifies the MIME Type for the body of this message
+ *
+ * @param bodyMIMEType The MIME Type for this message
+ */
+ public void setBodyMIMEType(String bodyMIMEType)
+ {
+ this.bodyMIMEType = bodyMIMEType;
+ }
/**
* Retrieves the body for this message. It may be directly manipulated by the
@@ -431,7 +451,7 @@
// multipart. Otherwise, just set the text of the message.
if (attachments.isEmpty())
{
- message.setText(body.toString());
+ message.setContent(body.toString(), bodyMIMEType);
}
else
{
--
Gitblit v1.10.0