diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementRepository.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementRepository.java index 048317a1e73..e2cd42c7912 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementRepository.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementRepository.java @@ -17,11 +17,8 @@ */ package org.wso2.carbon.device.mgt.core; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.common.spi.DeviceManager; -import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOException; import org.wso2.carbon.device.mgt.core.util.DeviceManagerUtil; import java.util.HashMap; 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 4618a1703ca..5968b153653 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 @@ -257,24 +257,16 @@ public class DeviceManagementServiceProviderImpl implements DeviceManagementServ StringBuilder messageBuilder = new StringBuilder(); try { - String title = ""; - if (emailMessageProperties.getTitle() != null){ - title = emailMessageProperties.getTitle(); - } - messageHeader = messageHeader.replaceAll("\\{" + EmailConstants.EnrolmentEmailConstants.TITLE + "\\}", - URLEncoder.encode(title, EmailConstants.EnrolmentEmailConstants.ENCODED_SCHEME)); messageHeader = messageHeader.replaceAll("\\{" + EmailConstants.EnrolmentEmailConstants.FIRST_NAME + "\\}", URLEncoder.encode(emailMessageProperties.getFirstName(), EmailConstants.EnrolmentEmailConstants.ENCODED_SCHEME)); messageBody = messageBody + System.getProperty("line.separator") + url.replaceAll("\\{" - + EmailConstants.EnrolmentEmailConstants.DOwN_LOAD_URL + "\\}", + + EmailConstants.EnrolmentEmailConstants.DOWNLOAD_URL + "\\}", URLDecoder.decode(emailMessageProperties.getEnrolmentUrl(), EmailConstants.EnrolmentEmailConstants.ENCODED_SCHEME)); - messageBuilder.append(messageHeader).append(System.getProperty("line.separator")).append( - System.getProperty("line.separator")); - messageBuilder.append(messageBody).append(System.getProperty("line.separator")).append( - System.getProperty("line.separator")).append(messageFooter); + messageBuilder.append(messageHeader).append(System.getProperty("line.separator")); + messageBuilder.append(messageBody).append(System.getProperty("line.separator")).append(messageFooter); } catch (IOException e) { log.error("IO error in processing enrol email message "+emailMessageProperties); @@ -312,12 +304,6 @@ public class DeviceManagementServiceProviderImpl implements DeviceManagementServ StringBuilder messageBuilder = new StringBuilder(); try { - String title = ""; - if (emailMessageProperties.getTitle() != null){ - title = emailMessageProperties.getTitle(); - } - messageHeader = messageHeader.replaceAll("\\{" + EmailConstants.EnrolmentEmailConstants.TITLE + "\\}", - URLEncoder.encode(title, EmailConstants.EnrolmentEmailConstants.ENCODED_SCHEME)); messageHeader = messageHeader.replaceAll("\\{" + EmailConstants.EnrolmentEmailConstants.FIRST_NAME + "\\}", URLEncoder.encode(emailMessageProperties.getFirstName(), EmailConstants.EnrolmentEmailConstants.ENCODED_SCHEME)); @@ -327,18 +313,16 @@ public class DeviceManagementServiceProviderImpl implements DeviceManagementServ .ENCODED_SCHEME)); messageBody = messageBody.replaceAll("\\{" + EmailConstants.EnrolmentEmailConstants.PASSWORD + "\\}", - URLEncoder.encode(emailMessageProperties.getUserName(), EmailConstants.EnrolmentEmailConstants + URLEncoder.encode(emailMessageProperties.getPassword(), EmailConstants.EnrolmentEmailConstants .ENCODED_SCHEME)); messageBody = messageBody + System.getProperty("line.separator") + url.replaceAll("\\{" - + EmailConstants.EnrolmentEmailConstants.DOwN_LOAD_URL + "\\}", + + EmailConstants.EnrolmentEmailConstants.DOWNLOAD_URL + "\\}", URLDecoder.decode(emailMessageProperties.getEnrolmentUrl(), EmailConstants.EnrolmentEmailConstants.ENCODED_SCHEME)); - messageBuilder.append(messageHeader).append(System.getProperty("line.separator")).append( - System.getProperty("line.separator")); - messageBuilder.append(messageBody).append(System.getProperty("line.separator")).append( - System.getProperty("line.separator")).append(messageFooter); + messageBuilder.append(messageHeader).append(System.getProperty("line.separator")); + messageBuilder.append(messageBody).append(System.getProperty("line.separator")).append(messageFooter); } catch (IOException e) { log.error("IO error in processing enrol email message "+emailMessageProperties); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/email/EmailConstants.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/email/EmailConstants.java index 9e37b57ed67..2fac0913196 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/email/EmailConstants.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/email/EmailConstants.java @@ -20,9 +20,8 @@ package org.wso2.carbon.device.mgt.core.email; public final class EmailConstants { public static final class EnrolmentEmailConstants { - public static final String TITLE = "title"; public static final String USERNAME = "user-name"; - public static final String DOwN_LOAD_URL = "downloadUrl"; + public static final String DOWNLOAD_URL = "downloadUrl"; public static final String ENCODED_SCHEME = "UTF-8"; public static final String PASSWORD = "password"; public static final String FIRST_NAME = "first-name"; 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 796b7fd06eb..e3aaa462a02 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 @@ -19,29 +19,34 @@ -
Dear {title} {first-name},
- You have been registered to the WSO2 MDM. Below is the link to enroll. - {downloadUrl} -
+ Enroll your Device with WSO2 MDM +
Dear {first-name},
+ + You have been registered to the WSO2 MDM. Below is the link to enroll. + + {downloadUrl} +
Best Regards, - WSO2 MDM Team + WSO2 MDM Team. http://www.wso2.com -
- Enrol your device with WSO2 MDM +
-
Dear {title} {first-name},
- You have been registered to WSO2 MDM with following credentials. + Enroll your Device with WSO2 MDM +
Dear {first-name},
+ + You have been registered to WSO2 MDM with following credentials. + Username: {user-name} Password: {password} + Below is the link to enroll. {downloadUrl}
Best Regards, - WSO2 MDM Team + WSO2 MDM Team. http://www.wso2.com
- Enrol your device with WSO2 MDM
\ No newline at end of file