there's a logic step that you are missing....
the grid is - usually - protected with signed urls, if you want to access
the "edit" form of the grid itself. First of all, you should embed in the
mail the signed url, otherwise a "not authorized" is expected.
but, since the signature depends on the specific user accessing the site,
you can't know in advance what will be his session key.
You'd better prepare a "bounce" link to send by email, and redirect from
there to the signed link to access the record (cause when the user access
the "bounce" page, you know how to generate his specific signature)
On Thursday, March 21, 2013 3:51:21 AM UTC+1, Jim S wrote:
>
> I want to automatically generate an email whenever a record is added to a
> specific table and embed in that email a link to edit the record using
> SQFORM.grid.
>
> I have it working, sending the email and all, but when the user clicks on
> the link to view the record they get a 'not authorized' message.
>
> This happens even if the user is logging into a fresh session when
> clicking on the link.
>
> Here is the code I'm using:
>
> msg = ('<html><head></head><body>A new support ticket was added. Click
> <a
> href="http://127.0.0.1:8000/ibc/support/index/edit/support_tickets/%s">here</a>
>
> to view.</body></html>' % (id))
> mail.send('[email protected]','New IBC Lead added',msg)
>
> Any ideas?
>
> -Jim
>
--
---
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.