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

Re: [sup-talk] New User Hooks Details



On Fri, Feb 4, 2011 at 9:15 PM, Philippe LeCavalier
<support@plecavalier.com> wrote:
> Hi.
>
> Excerpts from Hamish D's message of Thu Feb 03 18:48:56 -0500 2011:
>> > 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.
> Thanks for this. And thanks to everyone else who posted suggestions. Suffice it to say, I would have never figured that out on my own.
>
> I'm also seeing allot more info now with debugs here there and everywhere and can work from that.
>
> One question came to mind while I was fixing my hooks...Does the email address have to be complete or can it be just the domain? (I'm referring to the email address list in the referenced file of course)
>
> --
> Thanks,
> Phil
> _______________________________________________
> sup-talk mailing list
> sup-talk@rubyforge.org
> http://rubyforge.org/mailman/listinfo/sup-talk
>

I'm a bit biased but I think my gem sup_tag could help out. It makes
tagging messages pretty easy. For example:

tag do
  list_address /sup-talk/, :sup
end

tags all messages with sup-talk in the list address as sup. Checkout out:

https://github.com/blakesweeney/sup_tag


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