Hello,

I¹m trying to use a custom scrip that sends an outgoing email to a specified
email address when a ticket gets resolved. After much trudging through
archived emails on this list, I was able to accomplish that. But now,
sometimes when you click ³Reply² there is the following error:

Can't call method "head" on an undefined value at
/usr/local/lib/rt3/lib/RT/Action/SendEmail.pm line 278.

What¹s more, is my coworker got that error message in a totally different
queue. (I was hoping worst case scenario I¹d only mess up my own queue¹s
workflow, but that appears to be false.) So I was hoping someone could shed
some light...

-Why does this error happen when clicking Reply?
-Why does it apply to other queues?
-Can I fix it without disabling/deleting my scrip?

Scrip pasted below, thanks for any advice.

-Tyler




Condition: on resolve
Action: user defined
Template: transaction
Stage: transaction batch

prep code:

require RT::Action::SendEmail;
use strict;
use vars qw/@ISA/;
@ISA = qw(RT::Action::SendEmail);
$self->setUpEmail();
$self->SUPER::Prepare();
$self->SUPER::Commit();

sub setUpEmail {
    my $self = shift;
    my $ticket = $self->TicketObj;

    push @To, '[email protected]';
    @{ $self->{'To'} }  = @To;
    $self->{'Subject'}  = $ticket->OwnerObj->Name();
}

return 1;


cleanup code:

return 1;

Reply via email to