Does somebody achieved this? I'm trying to use a custom html template for auth.messages.verify_email but I can't get it to work. I tried with str.format() for using the second level of interpolation (as Jonathan suggested) but the error is the same: unsupported format character '!' (0x21) at index 187
The idea here is to use something like this: auth.messages.verify_email = response.render('my_custom_template.html', {'var1':'value1', 'var2':'value2'}) without conflicting with the dictionary that the core of web2py then passes before sending the email, as I can see in tools.py: self.messages.verify_email %dict(key=key, link=link) Any ideas? Thanks in advance. El lunes, 13 de agosto de 2012 22:09:46 UTC-3, JoeCodeswell escribió: > > Dear web2py folks, > > In the book it says in /chapter/29/9#Authentication: > > > In Auth, by default, email verification is disabled. To enable email, >> append the following lines in the model where auth is defined: >> >> 1. >> 2. >> 3. >> 4. >> 5. >> 6. >> 7. >> 8. >> 9. >> 10. >> 11. >> >> auth.settings.registration_requires_verification = False >> auth.settings.registration_requires_approval = False >> auth.settings.reset_password_requires_verification = True >> auth.messages.verify_email = 'Click on the link http://' + \ >> request.env.http_host + \ >> URL(r=request,c='default',f='user',args=['verify_email']) + \ >> '/%(key)s to verify your email' >> auth.messages.reset_password = 'Click on the link http://' + \ >> request.env.http_host + \ >> URL(r=request,c='default',f='user',args=['reset_password']) + \ >> '/%(key)s to reset your password' >> >> You need to replace the string >> >> 1. >> >> 'Click on the link ...' >> >> in auth.messages.verify_email with the proper complete URL of the action >> verify_email. > > > > > For both verify_email and reset_password: > Should I replace > > 'Click on the link http://' > With: > 'Click on the link http://myserver.com/myapp/' > Or with: > 'Click on the link http://myserver.com/myapp/default/user/verify_email' > My guess is the first, but because the book says "proper complete URL", I am > not sure. > > Thanks in advance for the help. > > Love and peace, > > Joe > > > > > -- 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 message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.