On Monday, 7 October 2013 09:04:07 UTC-5, lesssugar wrote:
>
> Here's the code of mailing/pass_reset.html:
>
> {{extend 'mailing/template.html'}}
>
> <tr>
> <td bgcolor="#ffffff" style="padding: 40px 30px 40px 30px;">
> <table border="0" cellpadding="0" cellspacing="0" width="100%">
> <tbody>
> <tr>
> <td style="color: #000000; font-family: Arial,
> sans-serif; font-size: 20px;">
> <b>Your requested password reset</b>
> </td>
> </tr>
> <tr>
> <td style="padding: 20px 0 30px 0; color: #333333;
> font-family: Arial, sans-serif; font-size: 14px; line-height: 22px;">
> Click the link below to continue:
> </td>
> </tr>
> <tr>
> <td style="padding: 20px 0 30px 0; color: #333333;
> font-family: Arial, sans-serif; font-size: 14px; line-height: 22px;">
> {{=link}}
> </td>
> </tr>
> <tr>
> <td style="padding: 10px 0 20px 0; color: #666666;
> font: italic 14px Georgia,serif; line-height: 22px;">
> MR Team
> </td>
> </tr>
> </tbody>
> </table>
> </td>
> </tr>
>
> The view extends mailing/template.html but I used the temaplate for other
> mailings which work correct, so I guess the template is not a problem.
>
>
> On Monday, October 7, 2013 3:29:20 PM UTC+2, Massimo Di Pierro wrote:
>>
>> Sorry. Now I understand better what you are trying to do. Your invalid
>> character must be in mailing/pass_reset.html. Can you show us that file?
>>
>> On Monday, 7 October 2013 04:17:53 UTC-5, lesssugar wrote:
>>>
>>> Your problem does not come from the code you show us
>>>
>>>
>>> When I comment this piece of code *(A)*:
>>> auth.messages.reset_password = response.render(
>>> 'mailing/pass_reset.html',
>>> dict(subject='Password reset',
>>> link = 'http://'+request.env.http_host+URL('default', 'user',
>>> args=['reset_password'])+'/%(key)s'))
>>>
>>> - password reset works with no errors.
>>>
>>> The code you are showing is wrong because your link contains "%(key)s"
>>>> which is unresolved
>>>
>>>
>>> What do you mean? This code is directly copied from the book. E.g. when
>>> I do this *(B)*, the reset works as well:
>>>
>>> auth.messages.reset_password = 'Click on link http://'+
>>> request.env.http_host + URL('default', 'user', args=['reset_password']) +
>>> '/%(key)s to reset your password'
>>>
>>> When I go with the earlier code *(A)*, it fails.
>>>
>>> Anyway, I'll keep digging. Thanks for help and suggestions.
>>>
>>>
>>>
>>>
>>> On Monday, October 7, 2013 4:36:22 AM UTC+2, Massimo Di Pierro wrote:
>>>>
>>>> I cannot help you without looking at the entire code. Your problem does
>>>> not come from the code you show us.
>>>>
>>>> The code you are showing is wrong because your link contains "%(key)s"
>>>> which is unresolved but this is not the cause of the (0x22) problem.
>>>>
>>>>
>>>> On Sunday, 6 October 2013 11:53:27 UTC-5, lesssugar wrote:
>>>>>
>>>>> Massimo (or anyone willing to help),
>>>>>
>>>>> all I'm trying to achieve is use my own email template to send a
>>>>> password-reset message to user. How do I do this properly?
>>>>>
>>>>> Currently, I have this
>>>>>
>>>>> *db.py*
>>>>> auth.messages.reset_password = response.render(
>>>>> 'mailing/pass_reset.html',
>>>>> dict(subject='Password reset',
>>>>> link = 'http://'+request.env.http_host+URL('default', 'user',
>>>>> args=['reset_password'])+'/%(key)s'))
>>>>>
>>>>> *pass_reset.html*
>>>>> ...
>>>>> <tr>
>>>>> <td style="padding: 20px 0 30px 0; color: #333333; font-family:
>>>>> Arial, sans-serif; font-size: 14px; line-height: 22px;">
>>>>> *{{=link}}*
>>>>> </td>
>>>>> </tr>
>>>>> ...
>>>>>
>>>>> I constantly get "unsupported format character" error. The character
>>>>> (0x22) is ASCII quotation mark: *"*. I don't see it in my code. It's
>>>>> getting a little bit frustrating as I'm not sure where to look for the
>>>>> bug.
>>>>>
>>>>> On Thursday, October 3, 2013 1:22:50 AM UTC+2, Massimo Di Pierro wrote:
>>>>>>
>>>>>> What is this supposed to do?
>>>>>>
>>>>>> {{=XML('%(key)s')}}
>>>>>>
>>>>>> Are you sure you are not looking for:
>>>>>>
>>>>>> <a href="{{=URL('default','user', args=('reset_password',key),
>>>>>> scheme=True, host=True)}}"> Go to password reset</a>
>>>>>>
>>>>>> Is key a variable?
>>>>>> Anyway, I am not sure your problem comes from this code.
>>>>>>
>>>>>> On Wednesday, 2 October 2013 08:14:17 UTC-5, lesssugar wrote:
>>>>>>>
>>>>>>> Sorry, Massimo, but I really don't get it. Is the slash causing the
>>>>>>> problem? I use '[controller_name]/[view_name.html]' to render other
>>>>>>> emails
>>>>>>> and it's all ok.
>>>>>>>
>>>>>>> I even tried to do it this way in the mailing view:
>>>>>>>
>>>>>>> <a href="{{=URL('default','user', args='reset_password',
>>>>>>> scheme=True, host=True)}}/{{=XML('%(key)s')}}"> Go to password reset
>>>>>>> </a>
>>>>>>>
>>>>>>> - and nothing, still the same error. I would be grateful for another
>>>>>>> hint, if there is one.
>>>>>>>
>>>>>>>
>>>>>>> On Tuesday, October 1, 2013 10:31:23 PM UTC+2, Massimo Di Pierro
>>>>>>> wrote:
>>>>>>>>
>>>>>>>> You probably have same strange character in
>>>>>>>> 'mailing/pass_reset.html'
>>>>>>>>
>>>>>>>> On Tuesday, 1 October 2013 13:26:46 UTC-5, lesssugar wrote:
>>>>>>>>>
>>>>>>>>> I'm trying to send a custom email template to user when they
>>>>>>>>> perform password reset:
>>>>>>>>>
>>>>>>>>> *db.py:*
>>>>>>>>>
>>>>>>>>> auth.messages.reset_password = response.render(
>>>>>>>>> 'mailing/pass_reset.html',
>>>>>>>>> dict(subject="Password reset",
>>>>>>>>> link=URL('default','user', args='reset_password')))
>>>>>>>>>
>>>>>>>>> and in *mailing/pass_reset.html*:
>>>>>>>>>
>>>>>>>>> ...
>>>>>>>>> <a href="{{=URL('default','user', args=['reset_password'],
>>>>>>>>> scheme=True, host=True) + '/%(key)s'}}"> Go to password reset</a>
>>>>>>>>> ...
>>>>>>>>>
>>>>>>>>> and everytime I'm testing, I get this:
>>>>>>>>>
>>>>>>>>> File "/home/username/www/web2py/gluon/tools.py", line 2739, in
>>>>>>>>> email_reset_password
>>>>>>>>> dict(key=reset_password_key, link=link)):
>>>>>>>>> ValueError: unsupported format character '"' (0x22) at index 411
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Any ideas what might be wrong?
>>>>>>>>>
>>>>>>>>>
--
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/groups/opt_out.