possible bug or simple mistake on my part?

I am using the latest version of coldbox from github.

I have a property set at the top of my model that grabs the Renderer plugin.

I am using the renderLayout function to return back both the layout & view data into a variable where I am passing that information into an email that I am sending thru PostMarkApp.com.

var pm = postmarkapp.setAPIKey(postmarkapikey);

pm.setTo(‘blah@blah.com’);

pm.setFrom(‘blah@blah.com’);

pm.setSubject(‘My Subject’);

pm.setHTMLBody(renderer.renderLayout(layout=‘Layout.Email.HTML’,view=‘link/email/linkto.html’));

pm.setTextBody(renderer.renderLayout(layout=‘Layout.Email.Text’,view=‘link/email/linkto.text’));

pm.send();

However, when I set the HTMLBody or TextBody, the only data that is there is the Layout correctly rendered without the view data.

I tried changing the view to a fake name to see if an error would happen but it does not. However if I change the layout to a fake name, I immediately get an error.

The postmarkapp works correctly as I can pass a string of HTML or Text without any problem but it appears that RenderLayout isn’t adding the view information.

Here is data within my Layout
Layout.Email.HTML

Some Website


#renderView()#

Here is the data within my View
link/email/linkto.html

Thank-you for subscribing

  • Me

Here is what I get back in my email

Some Website

Some Website


Any ideas?


Jeremy R. DeYoung
Phone: 615.261.8201

FacebookLinkedInGoogle ReaderTwitterAmazonGoogle
RantsFromAMadMan.com

The problem is that you are not using the arguments.view in your layout. Change it to this so you can do passthrough for views:

Some Website


#renderView(arguments.view)#

The passthrough allows you to render directly from layouts if passed.

Do you have a better way to render a layout for an email template & view for that email? Or is this the way you would suggest?


Jeremy R. DeYoung
Phone: 615.261.8201

FacebookLinkedInGoogle ReaderTwitterAmazonGoogle
RantsFromAMadMan.com

Well, this is what I use to tell you the truth, since I don’t have to reinvent the wheel. I use the coldbox layout manager, and view renderings. I can even add some caching to it if needed.