it's got me puzzled too. the text I have in my view is used but it's prefixed response.write( and carriage returns are converted to \r\n
a dict in my view is displayed in emails as response.write(absurl) C mdipierro wrote: > ? > > why response.write( ... escape=False) ? > > On May 27, 12:13 pm, Carl <[email protected]> wrote: > > I've implemented the code but am one step away from a working > > solution. > > > > The variable message contains text "response.write( ... escape=False)" > > for each section of text and for each dictionary item I use in my > > view. > > > > any thoughts? > > > > C > > > > On May 27, 12:16 pm, mdipierro <[email protected]> wrote: > > > > > You can use the web2py template language to generate emails. > > > > > from gluon.template import parse_template > > > from gluon.tool import Mail > > > > > mail=Mail > > > mail.settings.server='smtp.gmail.com: > > > 587' > > > mail.settings.sender='[email protected]' > > > mail.settings.login=None or > > > 'username:password' > > > > > path=os.path.join(request.folder,"views") > > > context=dict(a=1,b=2,c=3,etc="etc") > > > message=parse_template('file.html',path=path,context=context) > > > mail.send(to=['[email protected]'],subject='None',message=message) > > > > > Massimo > > > > > On May 27, 4:28 am, Carl <[email protected]> wrote: > > > > > > web2py's templating for HTML pages makes managing page structure > > > > populated with dynamic content very straightforward and scalable. > > > > > > What approach is recommended to use this power to manage emails/email > > > > templates? > > > > > > My application sends out emails populated with a lot of dynamic data > > > > and before I compose a String for the body text in Python I wondered > > > > if the existing template engine could be harnessed (and if so, what's > > > > the recommended way to leverage it) > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---

