<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Grails Rocks &#187; mail</title>
	<atom:link href="http://www.anyware.co.uk/2005/tag/mail/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.anyware.co.uk/2005</link>
	<description>Grails, Apple, usability and world stuff</description>
	<lastBuildDate>Fri, 27 Jan 2012 13:52:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Latest Grails-mail plugin SVN commits fix GSP view rendering</title>
		<link>http://www.anyware.co.uk/2005/2008/09/11/latest-grails-mail-plugin-svn-commits-fix-gsp-view-rendering/</link>
		<comments>http://www.anyware.co.uk/2005/2008/09/11/latest-grails-mail-plugin-svn-commits-fix-gsp-view-rendering/#comments</comments>
		<pubDate>Thu, 11 Sep 2008 14:31:42 +0000</pubDate>
		<dc:creator>Marc Palmer</dc:creator>
				<category><![CDATA[Groovy and Grails]]></category>
		<category><![CDATA[Programming links]]></category>
		<category><![CDATA[Grails]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://www.anyware.co.uk/2005/?p=205</guid>
		<description><![CDATA[The other day I committed some further improvements to the experimental email body rendering from GSP views. There is no release of grails-mail with this code in, you need to manually svn checkout and build it from the grails-plugins SVN repo. Anyway, the fixes allow you to render email body GSPs where the GSP may [...]]]></description>
			<content:encoded><![CDATA[<p>The other day I committed some further improvements to the experimental email body rendering from GSP views. There is no release of grails-mail with this code in, you need to manually svn checkout and build it from the grails-plugins SVN repo.</p>
<p>Anyway, the fixes allow you to render email body GSPs where the GSP may live in a plugin, or be overriden by your app. To do this, you have to specify the plugin name when rendering the body of the mail &#8211; this is required because there&#8217;s currently no way Grails can know where the view might be as the contents of plugin view trees are not merged with the app view tree. I can see scope for a future improvement in Grails core, to add all plugin view paths to the resource search paths during development, and shipping a single merged views/ tree within .WAR files built by Grails.</p>
<p>So here&#8217;s how you render a mail body from a view in a controller with grails-mail installed:</p>
<pre lang="groovy">sendMail {
   to "test@somewhere.com"
   subject "Hello"
   body(view:'/something/mailbody1.gsp',
      plugin:'my-great-plugin')
}</pre>
<p>This will try to locate the view in:</p>
<p>&lt;app&gt;/grails-app/views/something/mailbody1.gsp</p>
<p>but if it can&#8217;t find it, will try:</p>
<p>&lt;app&gt;/plugins/my-great-plugin-&lt;vernum&gt;/grails-app/views/something/mailbody1.gsp</p>
<p>Also these commits fix GSP taglibs in email bodies. Previously they&#8217;d appear in the HTML response of the controller ooops&#8230; now they appear in the body of the mail as expected.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.anyware.co.uk/2005/2008/09/11/latest-grails-mail-plugin-svn-commits-fix-gsp-view-rendering/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 3/18 queries in 0.135 seconds using disk: basic

Served from: www.anyware.co.uk @ 2012-02-08 21:26:15 -->
