[rt-devel] Re: SetEnvelopeTo

Jesse jesse at fsck.com
Thu Apr 6 15:29:21 EDT 2000


On Thu, Apr 06, 2000 at 08:55:43PM +0200, Tobias Brox wrote:
> > Perhaps, SetRecipients should take
> > 
> > %args = ( To => undef,
> > 	  Cc => undef,
> > 	  Bcc =>undef,
> > 	  EnvelopeTo => undef);
> > 
> > and do the right thing with setting envelope-to to the sum of To,Cc and Bcc.
> 
> I think that is a bit out of the scope of "my" SetRecipients.  The idea is
> to allow the _logic_ to be easily separated.  That is, _finding_ the right
> To, Cc, Bcc and EnvelopeTo.  Maybe I'm wrong.
>

Ok. we'll leave it for now, but before we roll 2.0, I think I may want
to simplify this some. Rather than setting $self->{'To'} to an address
and then calling $self->SetTo, perhaps we should be calling 
$self->SetTo("address");  I think this is my fault from way back.




 
> Here's from the file I'm working at:
> 
> POD:
> 
> If you want to set the recipients of the mail to something other than
> the addresses mentioned in the To, Cc, Bcc and EnvelopeTo headers in
> the template, you should subclass RT::Action::SendEmail and override
> either the SetRecipients method or the SetTo, SetCc, etc methods (see
> the comments for the SetRecipients sub).
> 
> Comments & sub:
> 
> # The specialized SetRecipients sub should find out whom to send the
> # message to, and then set the header fields.
> 
> # If SendEmail is called rather than a subclass, the receipients have
> # to be set by the template.
> 
> # There is three ways to override this (well, more ways ... you could
> # of course add the logic to a specialized prepare or commit or
> # something ... but that's not considered a good way to do it anyway).
> 
> # 1: Override SetRecipients to set the header fields (to, cc, bcc) and
> #    eventually call SetEnvelopeTo
> # 2: Override SetRecipients to set the hash elements $self->{To}, {Cc}
> #    and {Bcc}, and then call SUPER::SetRecipients.
> # 3: Override SetTo, SetCc and/or SetBcc.
> 
> sub SetRecipients {
>   $self->SetTo();
>   $self->SetCc();
>   $self->SetBcc();
>   $self->SetEnvelopeTo();
> }
> 
> 

-- 
jesse reed vincent -- jrvincent at wesleyan.edu -- jesse at fsck.com 
pgp keyprint:  50 41 9C 03 D0 BC BC C8 2C B9 77 26 6F E1 EB 91
--------------------------------------------------------------
After all, it's not every day you meet up with an evil power
                                               -M. Bulgakov





More information about the Rt-devel mailing list