On 2003-11-04 08:21:10 +1100, Gavin Carr wrote:
> Can we get Transaction::recipients made into a mutator? i.e. replacing 
> the current recipient list instead of appending via add_recipients. I 
> know there will be gnashing of teeth among the purists, but there are 
> times where directly munging recipients is exactly what is required.

I needed this for my aliases plugin and added a "clear_recipients"
method to Transaction. The patch is in the same mail as the aliases
plugin. 

In the data_post hook, I then do something like:

    $transaction->clear_recipients();
    for (@new_recipients) {
        $transaction->add_recipient(Mail::Address->new('', $_));
    }

Yes, 
    $transaction->recipients(map {Mail::Address->new('', $_)}
                                 @new_recipients
                            );
would be a bit more elegant.

        hp

-- 
   _  | Peter J. Holzer    | We have failed our own creation and given
|_|_) | Sysadmin WSR       | birth something truly awful. We're just too
| |   | [EMAIL PROTECTED]         | busy cooing over the pram to notice.
__/   | http://www.hjp.at/ |       -- http://www.internetisshit.org

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to