From 0a824d96449289fc0b2177d2068c3621c65e4da1 Mon Sep 17 00:00:00 2001 From: manoj Date: Mon, 23 Mar 2015 12:16:51 +0530 Subject: [PATCH] Format enrol email message --- .../device/mgt/core/DeviceManagementServiceProviderImpl.java | 4 +++- .../src/main/resources/conf/notification-messages.xml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementServiceProviderImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementServiceProviderImpl.java index 96ef8378e1..9e37cc43c9 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementServiceProviderImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementServiceProviderImpl.java @@ -43,6 +43,7 @@ import org.wso2.carbon.device.mgt.core.service.DeviceManagementService; import org.wso2.carbon.device.mgt.core.util.DeviceManagerUtil; import java.io.IOException; +import java.net.URLDecoder; import java.net.URLEncoder; import java.util.ArrayList; import java.util.List; @@ -253,7 +254,8 @@ public class DeviceManagementServiceProviderImpl implements DeviceManagementServ URLEncoder.encode(userName, "UTF-8")); messageBody = messageBody+ System.getProperty("line.separator") + enrolmentNotifications.getUrl() - .replaceAll("\\{downloadUrl\\}", URLEncoder.encode(enrolUrl, "UTF-8")); + .replaceAll("\\{downloadUrl\\}", URLDecoder.decode(enrolUrl, "UTF-8")); + messageBuilder.append(messageHeader).append(System.getProperty("line.separator")) .append(System.getProperty("line.separator")); diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/conf/notification-messages.xml b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/conf/notification-messages.xml index 807329de5a..edfc7a924f 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/conf/notification-messages.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/conf/notification-messages.xml @@ -21,7 +21,7 @@
Dear {title} {user-name},
- Please go to the following url and enrol your device + You have been registered to the WSO2 MDM. Below is the link to enroll. {downloadUrl}