[DS-252] Interpolate variables in the Subject: line of email templates as well

git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@4083 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Stuart Lewis
2009-07-13 00:27:48 +00:00
parent 3b2d6d4fd3
commit b8e24c7954
2 changed files with 14 additions and 1 deletions

View File

@@ -316,7 +316,19 @@ public class Email
message.setSentDate(date);
message.setFrom(new InternetAddress(from));
message.setSubject(subject);
// Set the subject of the email (may contain parameters)
String fullSubject = MessageFormat.format(subject, args);
if (charset != null)
{
message.setSubject(fullSubject, charset);
}
else
{
message.setSubject(fullSubject);
}
// Add attachments
if (attachments.isEmpty())
{
// If a character set has been specified, or a default exists