[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sup-talk] New User Hooks Details



> One bit of info that seems odd to me is when I issue 'sup -l' the hooks listed are nowhere to be found in the hooks folder yet they appear to be working. Is that normal?

sup -l will list the hooks you can use - it doesn't check what hooks
you've actually created.

> sample hook:
> #Mark Lists <lists>
> addressfile = File.open("/home/plecavalier/.sup/hooks/label.lists","r")
> if ! addressfile.grep(/#{message.list_address}/).empty?
> message.add_label :lists
> end

You can stick debug statements in - say:

debug "list address is #{message.list_address.inspect}, type is
#{message.list_address.class.to_s}"

and then see it in the log (while using sup, press ";" and scroll down
to the log buffer).

I think that message.list_address is actually of class Person, so you
would want to use message.list_address.email for your case. I've
updated the wiki to correct that - I think I may have written the
wrong information into the wiki to start with :/ so sorry for the
mistake.

Hamish
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk