def messenger():
    mail.send(to="email", subject="welcome to icop", message="bla bla")

should be

def messenger(form):
    mail.send(to="email", subject="welcome to icop", message="bla bla")

yet. This should raise a ticket.

I tried and (with the change) it works for me. Try adding a print 
statement. It is possible the code is executed but the email is not going 
out for some reason.

On Thursday, 4 October 2012 21:29:39 UTC-5, Pystar wrote:
>
> def admin():
>     grid = SQLFORM.grid(db.auth_user, onupdate = messenger)
>     return locals()
>
> def messenger():
>     mail.send(to="email", subject="welcome to icop", message="bla bla")
>
> its not working as expected. i.e. on updating the records in the grid, no 
> message is sent to the user. rather it says that messenger doesnt accept 
> any arguments, but 1 was given. 
> HELP.
>
> On Thursday, October 4, 2012 9:43:32 PM UTC+1, Niphlod wrote:
>>
>> at least post whatever code you're trying to run without success :P
>>
>> On Thursday, October 4, 2012 10:03:10 PM UTC+2, Pystar wrote:
>>>
>>> it didnt work. I need help
>>>
>>> On Thursday, October 4, 2012 8:29:51 PM UTC+1, Pystar wrote:
>>>>
>>>> From the book, I can see this SQLFORM.grid(onupdate, oncreate, 
>>>> ondelete), I should believe that I can pass a function to the onupdate 
>>>> argument that will call a function to send mails whenever a record is 
>>>> updated. I believe this is correct without testing if it is now. Will do 
>>>> so 
>>>> and return with findings
>>>>
>>>> On Thursday, October 4, 2012 8:08:06 PM UTC+1, Pystar wrote:
>>>>>
>>>>> How do I customize SQLFORM.grid() to send a mail to users in a db 
>>>>> whenever data is updated from the grid? tips, hints?
>>>>>
>>>>>

-- 



Reply via email to