Re: [web2py] Re: emailing the content of the current page

2019-06-20 Thread Eliezer (Vlad) Tseytkin
this is simply awesome! thank you ! On Thu, Jun 20, 2019 at 2:07 PM Val K wrote: > #pretty decorator > def with_email_to(addr): > def inner(f): > def emailer(): > ret = f() > html = response.render(ret) > ... # send html to addr by email >

Re: [web2py] Re: emailing the content of the current page

2019-06-20 Thread Val K
#pretty decorator def with_email_to(addr): def inner(f): def emailer(): ret = f() html = response.render(ret) ... # send html to addr by email return html return emailer return inner @with_email_to('j...@google.com') def foo()

Re: [web2py] Re: emailing the content of the current page

2019-06-20 Thread Eliezer (Vlad) Tseytkin
oops got it! changing it right now! simple and brilliant, as always :) On Thu, Jun 20, 2019 at 1:39 PM Val K wrote: > I mean the following logic: > def foo(): > ... > ret = dict(...) > if email_required: > html = response.render(ret) > ... # send html by email >

[web2py] Re: emailing the content of the current page

2019-06-20 Thread Val K
I mean the following logic: def foo(): ... ret = dict(...) if email_required: html = response.render(ret) ... # send html by email return html return ret On Thursday, June 20, 2019 at 8:26:33 PM UTC+3, Vlad wrote: > > I couldn't figure out how this wok

[web2py] Re: emailing the content of the current page

2019-06-20 Thread Vlad
I couldn't figure out how this woks, so just rendered it again. Not a big deal - just a matter of convenience. The email requests come occasionally, so this extra render doesn't cause trouble. Thank you, Val! On Thursday, June 20, 2019 at 6:23:55 AM UTC-4, Val K wrote: > > I think you can try

Re: [web2py] Re: Emailing

2015-08-07 Thread Anthony Smith
Are got it. thankyou On Sat, Aug 8, 2015 at 9:58 AM, 黄祥 wrote: > e.g. > *private/appconfig.ini* > [smtp] > server = smtp.gmail.com:587 > sender = em...@gmail.com > login = email:password > > *models/db.py* > from gluon.tools import Auth, Crud, Service, PluginManager, prettydate > auth = Auth(d

[web2py] Re: Emailing

2015-08-07 Thread 黄祥
e.g. *private/appconfig.ini* [smtp] server = smtp.gmail.com:587 sender = em...@gmail.com login = email:password *models/db.py* from gluon.tools import Auth, Crud, Service, PluginManager, prettydate auth = Auth(db) mail = auth.settings.mailer mail.settings.server = 'logging' if request.is_local

[web2py] Re: Emailing

2015-08-07 Thread Anthony Smith
I have looked at that but still cant figure out, do you have example cheers tony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this mess

[web2py] Re: Emailing

2015-08-07 Thread 黄祥
please take a look at the book : http://web2py.com/books/default/chapter/29/08/emails-and-sms best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Iss

[web2py] Re: emailing a pdf view as an attachment

2014-08-05 Thread Massimo Di Pierro
Yes. In at least three ways. web2py ships with pyfpdf (in gluon.contrib) which converts html to pdf. Once you make the file you can also add as an attachment to an email (look the web2py email API). You can install/unzip reportlab in web2py/site-packages and use that alternatively. Also, if you

Re: [web2py] Re: emailing From: full name

2013-01-08 Thread Jonathan Lundell
On 8 Jan 2013, at 11:40 AM, Adi wrote: > Hi Jonathan, > Mine is putting properly company name in front of the address, by using: > mail.settings.sender = 'Company', but knowing that you are a guru here, may > not be at all what you are looking for... If you wanted I could send you a > sample e

[web2py] Re: emailing From: full name

2013-01-08 Thread Adi
Hi Jonathan, Mine is putting properly company name in front of the address, by using: mail.settings.sender = 'Company', but knowing that you are a guru here, may not be at all what you are looking for... If you wanted I could send you a sample email privately to see if that's what you needed?