it's a path relative to the app's *views *folder. With this code your *
message.html* should be next to layout.html, just in the *yourapp/views/*folder.

Il giorno venerdì 7 settembre 2012 17:04:27 UTC+2, Daniel Gonzalez ha 
scritto:
>
> As explained here:
>
>
> http://web2py.com/books/default/chapter/29/8#Using-the-template-system-to-generate-messages
>
> The following code can be used to render a view file to send via email:
>
> for person in db(db.person).select():
>     context = dict(person=person)
>     message = response.render('message.html', context)
>     mail.send(to=['w...@example.com <javascript:>'],
>               subject='None',
>               message=message)
>
> I have tried this, but I am not able to place the "message.html" correctly 
> in the directory hierarchy.
> How does reponse.render find the view files, or, even better, how can I 
> tell response.render where to find my template file?
>
> Thanks,
> Daniel
>

-- 



Reply via email to