Groups
Groups
Sign in
Groups
Groups
Express
Conversations
About
Send feedback
Help
Get resulting view as string, instead of rendering
478 views
Skip to first unread message
Alex Brown
unread,
Apr 18, 2012, 9:54:59 PM
4/18/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to expre...@googlegroups.com
I'm trying to use my view templates to generate HTML for sending emails.
Is there a way to do this with express?
Should i be using the template engine directly?
kind of like:
var html = render('myView', model:myModel);
Sugarstack
unread,
Apr 20, 2012, 4:13:47 AM
4/20/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to expre...@googlegroups.com
You can pass a callback to res.render. That will stop it sending anything, and you can access the rendered HTML (or err) to do w/e with.
tjholowaychuk
unread,
Apr 20, 2012, 5:06:06 PM
4/20/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to expre...@googlegroups.com
there's app.render() and res.render(), res.render() has an optional callback of (err, html), and app.render always requires a callback
Reply all
Reply to author
Forward
0 new messages