osh 2 years ago
parent 0f28d318ed
commit d2bc463284

@ -70,6 +70,7 @@ public final class DeviceManagementConfig {
private EnrollmentNotificationConfiguration enrollmentNotificationConfiguration;
private DefaultRoles defaultRoles;
private OperationTimeoutConfiguration operationTimeoutConfiguration;
private String enrollmentGuideMail;
@XmlElement(name = "ManagementRepository", required = true)
public DeviceManagementConfigRepository getDeviceManagementConfigRepository() {
@ -265,5 +266,14 @@ public final class DeviceManagementConfig {
public void setOperationTimeoutConfiguration(OperationTimeoutConfiguration operationTimeoutConfiguration) {
this.operationTimeoutConfiguration = operationTimeoutConfiguration;
}
@XmlElement(name = "EnrollmentGuideMail", required = true)
public String getEnrollmentGuideMail() {
return enrollmentGuideMail;
}
public void setEnrollmentGuideMail(String enrollmentGuideMail) {
this.enrollmentGuideMail = enrollmentGuideMail;
}
}

@ -1559,17 +1559,18 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
@Override
public void sendEnrolmentGuide(String enrolmentGuide) throws DeviceManagementException {
DeviceManagementConfig config = DeviceConfigurationManager.getInstance().getDeviceManagementConfig();
String recipientMail = config.getEnrollmentGuideMail();
Properties props = new Properties();
props.setProperty("mail-subject", "[Enrollment Guide Triggered] (#" + ++count + ")");
props.setProperty("enrollment-guide", enrolmentGuide);
try {
EmailMetaInfo metaInfo = new EmailMetaInfo("support-dev-group@entgra.io", props);
EmailMetaInfo metaInfo = new EmailMetaInfo(recipientMail, props);
sendEnrolmentInvitation(DeviceManagementConstants.EmailAttributes.ENROLLMENT_GUIDE_TEMPLATE, metaInfo);
} catch (ConfigurationManagementException e) {
String msg = "Error occurred while sending the mail.";
log.error(msg);
log.error(msg, e);
throw new DeviceManagementException(msg, e);
}
}

@ -187,5 +187,6 @@
<OperationTimeouts>
</OperationTimeouts>
</OperationTimeoutConfigurations>
<EnrollmentGuideMail>support-dev-group@entgra.io</EnrollmentGuideMail>
</DeviceMgtConfiguration>

@ -322,7 +322,7 @@
</Role>
</Roles>
</DefaultRoles>
<OperationTimeoutConfigurations>
<OperationTimeoutConfigurations>
<OperationTimeouts>
<!--<OperationTimeout>-->
<!--<DeviceTypes>-->
@ -350,6 +350,11 @@
{% endfor %}
{% endif%}
</OperationTimeouts>
</OperationTimeoutConfigurations>
</OperationTimeoutConfigurations>
{% if device_mgt_conf.enrollment_guide_mail is defined %}
<EnrollmentGuideMail>{{device_mgt_conf.enrollment_guide_mail}}</EnrollmentGuideMail>
{% else %}
<EnrollmentGuideMail>support-dev-group@entgra.io</EnrollmentGuideMail>
{% endif %}
</DeviceMgtConfiguration>

Loading…
Cancel
Save