Friday December 13, 2002
E-Mail Notification of Comments
I requested a new feature today for Roller - the ability to receive e-mail notification when comments have been posted. I mentioned this wouldn't be too hard using the mailer tag library. So I got slightly motivated and did it myself. I think to add it to Roller, we should make it a little more configurable, but here's what I added above the form in weblog/comment-form.jspf:
... define mailer and c taglibs of course ...
<c:if test="$\{param.method == 'update'\}">
<mt:mail server="smtp.domain.com">
<mt:setrecipient type="to">myname@domain.com</mt:setrecipient>
<mt:from><c:out value="${param.email}"/></mt:from>
<mt:subject>Comment: <bean:write name="blogEntry"
property="title" scope="request" /></mt:subject>
<mt:message><c:out value="${param.content}"/>
<c:out value="${param.name}"/>
<c:out value="${param.url}"/>
</mt:message>
<mt:send>
Doh! An error has occurred sending comments notification!<br />
<mt:error id="err">
<jsp:getProperty name="err" property="error"/>
</mt:error>
</mt:send>
</mt:mail>
</c:if>
I had to put those \'s in their in order to get past Velocity. The one pain with the mailer tag library is everything comes through with the spacing as set in the JSP. That's why the name and url variables are squished all the way over to the left.
Posted in Java
at Dec 13 2002, 07:21:56 AM MST
2 Comments
Search This Site
Recent Entries
- Wine Tasting in Napa Valley
- How to build a Shot-Ski
- Bus Project Update
- Farewell to the 2011-2012 Ski Season
- Cruising around the Western Caribbean
- Spring Break!
- A Spectacular Trip to Stockholm and Madrid
- Comparing Web Frameworks and HTML5 with Play Scala at Jfokus 2012
- Play Framework 2.0 with Peter Hilton at Jfokus
- Secure JSON Services with Play Scala and SecureSocial
Posted by Lance on December 13, 2002 at 08:46 AM MST #
Posted by Matt Raible on December 13, 2002 at 09:07 AM MST #