summaryrefslogtreecommitdiff
path: root/rt/lib/RT/Action/Autoreply.pm
diff options
context:
space:
mode:
Diffstat (limited to 'rt/lib/RT/Action/Autoreply.pm')
-rwxr-xr-xrt/lib/RT/Action/Autoreply.pm64
1 files changed, 64 insertions, 0 deletions
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;