my template "see attached file"
in the console:
response.render('templates/email_verification.html',dict(key="teststr"))
works ok
but
response.render('templates/email_verification.html') % dict(key="teststr")
does not work
i get
unsupported format character '!' (0x21) at index 615
this is the same behaviour as
email_body = messages.verify_email % d
so i cannot pass parameters inside the render function
verify email will interpolate it with a dict
i already have other html emails working but the *verify_email* one is
doomed...
any ideas?
regards
António
2016-11-21 13:21 GMT+00:00 Leonel Câmara <[email protected]>:
> username is passed by auth, and it's not necessarily the "username" field
> it can be the email if you're not using an username.
>
> Basically after register if you have registration_requires_verification
> auth send an email where the body is defined as
>
> d = dict(form.vars) # form.vars holds the registration form values
> d.update(dict(key=key, link=link, username=form.vars[username])) #
> exactly what username is, is defined earlier according to your settings
> email_body = messages.verify_email % d
>
>
> You can actually build verify_email using html helpers if you aren't being
> able to do it with response.render
>
> auth.messages.verify_email = HTML(
> HEAD(),
> BODY(
> H1(T('Welcome to MY AMAZING WEBSITE'
> )),
> P(T('Click on the link below to check
> your e-mail'), ':'),
> A(URL(r=request,c='default',f='user',
> args=['verify_email'], scheme=True, host=True) + '/%(key)s ', _href=URL(r=
> request,c='default',f='user',args=['verify_email'], scheme=True, host=True
> ) + '/%(key)s '),
> P(T('Thank You')),
> P(T('From MY AMAZING WEBSITE')),
> )
> ).xml()
>
> Another alternative is to just use a string with HTML in there.
>
> --
> 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 [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.
Title: Template Base
FileIt: Account validation
|
|
|
|
|
Security is important for us, so this is a 2 phase validation. After your validation we will also validate your account so please be patient. We will inform you as soon as our validation terminates...
|
|
|
|
|
This is a sample template from BEE free email editor Visit beefree.io to create beautiful and rich email messages at no cost.
|
|
|
|
|
|
|