Author: lucaa Date: 2008-02-21 17:04:57 +0100 (Thu, 21 Feb 2008) New Revision: 7903
Modified: xwiki-products/xwiki-watch/trunk/wikis/watch/src/main/resources/WatchCode/SendPressReviewEmail Log: XWATCH-111: PressReview email not generated correctly when guest user does not have view rights on the WatchCode.PressReview document * PressReview's content is now rendered in the context of the current document. Modified: xwiki-products/xwiki-watch/trunk/wikis/watch/src/main/resources/WatchCode/SendPressReviewEmail =================================================================== --- xwiki-products/xwiki-watch/trunk/wikis/watch/src/main/resources/WatchCode/SendPressReviewEmail 2008-02-21 14:07:45 UTC (rev 7902) +++ xwiki-products/xwiki-watch/trunk/wikis/watch/src/main/resources/WatchCode/SendPressReviewEmail 2008-02-21 16:04:57 UTC (rev 7903) @@ -74,24 +74,13 @@ } //for all the rest of parameters from the request, send them to the pressReview prDoc = xwiki.getDocument("WatchCode.PressReview"); - url = prDoc.getExternalURL("view", "&xpage=plain"); - parameters = request.getParameterMap(); - for (par in parameters) { - if (!(par.key.equals("address") || par.key.equals("content") || par.key.equals("subject"))) { - //just perfect to pass further - if (par.value instanceof String) { - url += "&" + par.key + "=" + xwiki.getURLEncoded(par.value); - } else { - url += "&" + par.key + "=" + xwiki.getURLEncoded(par.value[0]); - } - } - } //get addressses errorMessage = ""; error = false; addresses = ""; + renderedPR = xwiki.renderText(prDoc.getContent(), doc); for (addr in request.getParameterValues("address")) { - message = "<div style='line-height: 1.5em'>" + content + "<br />" + xwiki.getURLContent(url) + "</div>"; + message = "<div style='line-height: 1.5em'>" + content + "<br />" + renderedPR + "</div>"; //mailResult = xwiki.mailsender.sendTextMessage(xwiki.getXWikiPreference("admin_email"), addr, subject, message); mailResult = xwiki.mailsender.sendHtmlMessage(" XWiki Watch " + "<" + xwiki.getXWikiPreference("admin_email") + ">", addr, null, null, subject, message, message, null); if (mailResult == 0) { _______________________________________________ notifications mailing list notifications@xwiki.org http://lists.xwiki.org/mailman/listinfo/notifications