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
#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
Any ideas?
Jeremy R. DeYoung
Phone: 615.261.8201