Hi everyone,
I'm using Play templates to render some plain text emails for me. Everything is working fine, except for one big problem; there are newlines all over the place that I can't get rid of. It appears that every dynamic statement (anything starting with a "@") results in an empty line. In addition, even closing braces are resulting in a new line. For example, this:
-------------------------
@for(p <- products) {
@p.getName() ($@p.getPrice())
@for(c <- coupons) {
@c.title
}
}
--------------------------
Is being rendered as this:
-------------------------
Product 1 ($1.00)
$0.50 Off Product 1
-------------------------
Is there any way to fix this? I don't understand how a closing brace should ever translate to a newline, but who knows? I know I can obviously write a regex and brute force fix it in my controller, but that deletes newlines that are supposed to be in there. I've been searching around the web, and for html, the recommendation seems to be to use Google's HTMLCompressor, but I don't see any plaintext solution.
Thanks in advance for the help!
Joe