From 3ef62a0570055da710328937e7f65dbb2c027c62 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 12 Aug 2002 06:17:09 +0000 Subject: import rt 2.0.14 --- rt/lib/RT/Action/Autoreply.pm | 64 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100755 rt/lib/RT/Action/Autoreply.pm (limited to 'rt/lib/RT/Action/Autoreply.pm') diff --git a/rt/lib/RT/Action/Autoreply.pm b/rt/lib/RT/Action/Autoreply.pm new file mode 100755 index 000000000..624888e94 --- /dev/null +++ b/rt/lib/RT/Action/Autoreply.pm @@ -0,0 +1,64 @@ +#$Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Action/Autoreply.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $ + +package RT::Action::Autoreply; +require RT::Action::SendEmail; +@ISA = qw(RT::Action::SendEmail); + + +# {{{ sub SetRecipients + +=head2 SetRecipients + +Sets the recipients of this message to this ticket's Requestor. + +=cut + + +sub SetRecipients { + my $self=shift; + + push(@{$self->{'To'}}, @{$self->TicketObj->Requestors->Emails}); + + return(1); +} + +# }}} + + +# {{{ sub SetReturnAddress + +=head2 SetReturnAddress + +Set this message\'s return address to the apropriate queue address + +=cut + +sub SetReturnAddress { + my $self = shift; + my %args = ( is_comment => 0, + @_ + ); + + if ($args{'is_comment'}) { + $replyto = $self->TicketObj->QueueObj->CommentAddress || + $RT::CommentAddress; + } + else { + $replyto = $self->TicketObj->QueueObj->CorrespondAddress || + $RT::CorrespondAddress; + } + + unless ($self->TemplateObj->MIMEObj->head->get('From')) { + my $friendly_name=$self->TicketObj->QueueObj->Name; + $self->SetHeader('From', "\"$friendly_name\" <$replyto>"); + } + + unless ($self->TemplateObj->MIMEObj->head->get('Reply-To')) { + $self->SetHeader('Reply-To', "$replyto"); + } + +} + +# }}} + +1; -- cgit v1.2.1