Merge pull request #1411 from tuub/DS-3214

Build the request response token link for in the Request item E-mail
This commit is contained in:
Tim Donohue
2016-05-25 15:51:42 -04:00

View File

@@ -220,6 +220,8 @@ public class RequestItemServlet extends DSpaceServlet
String token = requestItemService.createRequest(context, bitstream_id != null? String token = requestItemService.createRequest(context, bitstream_id != null?
bitstreamService.find(context, bitstream_id):null, item, allfiles, requesterEmail, reqname, coment); bitstreamService.find(context, bitstream_id):null, item, allfiles, requesterEmail, reqname, coment);
String linkedToken = getLinkTokenEmail(context, token);
// All data is there, send the email // All data is there, send the email
Email email = Email.getEmail(I18nUtil.getEmailFilename( Email email = Email.getEmail(I18nUtil.getEmailFilename(
context.getCurrentLocale(), "request_item.author")); context.getCurrentLocale(), "request_item.author"));
@@ -243,7 +245,7 @@ public class RequestItemServlet extends DSpaceServlet
.getHandle())); .getHandle()));
email.addArgument(title); // request item title email.addArgument(title); // request item title
email.addArgument(coment); // message email.addArgument(coment); // message
email.addArgument(token); email.addArgument(linkedToken);
email.addArgument(authorName); // corresponding author name email.addArgument(authorName); // corresponding author name
email.addArgument(authorEmail); // corresponding author email email.addArgument(authorEmail); // corresponding author email
@@ -532,14 +534,17 @@ public class RequestItemServlet extends DSpaceServlet
} }
} }
/** /**
* Get the link to the author in RequestLink email. * Get the link to the author in RequestLink email.
* *
* @param email * @param context
* The email address to mail to * the context object
* * @param token
* @exception SQLExeption * the token
* *
* @return link based on the token
*
* @throws java.sql.SQLException
*/ */
public static String getLinkTokenEmail(Context context, String token) public static String getLinkTokenEmail(Context context, String token)
throws SQLException throws SQLException