String siteName = ConfigurationManager.getProperty("dspace.name");
// All data is there, send the email
try
{
Email email = Email.getEmail(I18nUtil.getEmailFilename(context.getCurrentLocale(), "suggest"));
email.addRecipient(recipAddr); // recipient address
email.addArgument(recipName); // 1st arg - recipient name
email.addArgument(senderName); // 2nd arg - sender name
email.addArgument(siteName); // 3rd arg - repository name
email.addArgument(title); // 4th arg - item title
email.addArgument(itemUri); // 5th arg - item handle URI
email.addArgument(itemUrl); // 6th arg - item local URL
email.addArgument(collName); // 7th arg - collection name
email.addArgument(message); // 8th arg - user comments
// Set sender's address as 'reply-to' address if supplied
if ( senderAddr != null && ! "".equals(senderAddr))
{
email.setReplyTo(senderAddr);
}
// Only actually send the email if feature is enabled
if (ConfigurationManager.getBooleanProperty("webui.suggest.enable", false))
{
email.send();
} else
{
throw new MessagingException("Suggest item email not sent - webui.suggest.enable = false");
}