Custom scrip with email

I am creating a scrip that sends an email to a user when they create a correspondence or comment and they don’t enter a value in the “Time Worked” field. The custom condition is:

if (($self->TransactionObj->TimeWorked == 0) && (($self->TransactionObj->Type eq “Correspond”) || ($self->Transaction->Type eq “Comment”))){
return 1;}
return undef;}

but this doesn’t seem to work. My question is if there are any syntax errors in the above condition and also how can I build a custom action to send an email to the creator of the transaction.

Andy Werner
Help Desk Intern
AMX International, INC.
(208) 542-8230