I am using DSpace version 8
Inside the public void send() method, replace the following 3 lines:
if (attachments.isEmpty() && moreAttachments.isEmpty()) {
// If a character set has been specified, or a default exists
if (charset != null) {
// message.setText(fullMessage, charset);
message.setContent(fullMessage, "text/html; charset=" + charset);
} else {
// message.setText(fullMessage);
message.setContent(fullMessage, "text/html; charset=UTF-8");
}
} else {
Multipart multipart = new MimeMultipart();
// create the first part of the email
BodyPart messageBodyPart = new MimeBodyPart();
// messageBodyPart.setText(fullMessage);
messageBodyPart.setContent(fullMessage, "text/html; charset=" + charset);
multipart.addBodyPart(messageBodyPart);
}
Add the following HTML code:
#set($subject = "${config.get('dspace.name')} Account Registration")
#set($phone = ${config.get('mail.message.helpdesk.telephone')})
<html>
<head>
<style>
body {
font-family: Arial, sans-serif;
font-size: 14px;
line-height: 1.6;
}
.highlight {
color: #007bff;
font-weight: bold;
}
</style>
</head>
<body>
<p>Dear User,</p>
<p>To complete registration for a <strong><i>${config.get('dspace.name')}</i></strong> account, please click the link below:</p>
<p><a href="${params[0]}" class="highlight">${params[0]}</a></p>
<p>If you need assistance with your account, please email <a href="mailto:${config.get('mail.helpdesk')}">${config.get('mail.helpdesk')}</a></p>
#if( $phone )
<p>Or call us at ${phone}.</p>
#end
<p>The ${config.get('dspace.name')} Team</p>
</body>
</html>
cd C:\dSpace mvn package
cd C:\dspace\target\dspace-installer ant fresh_install Note: After running the above commands, replace the dspace.cfg and local.cfg files with your previous backup as the commands may override the email settings.
Deploy the WebApp Copy the webapps folder from: C:\dspace\webapps to C:\Program Files\Apache Software Foundation\Tomcat 10.1\webapps
Restart Services Stop and restart Solr:
solr stop -p 8983 solr start -p 8983 Stop and restart the Tomcat service: