[rt-users] Scrip send email on create

Kenneth Crocker KFCrocker at lbl.gov
Tue Feb 3 18:31:25 EST 2009


Dan,


	I didn't see a template listed. listed. I don't think an Email can be 
sent without one.


Kenn
LBNL

On 2/2/2009 4:05 PM, Dan O'Neill wrote:
> Enclosed is a script that adds one or more AdminCC's to a ticket during 
> Create. This does not cause the AdminCC's to receive an email.
> 
> How do I modify this Scrip or otherwise configure the Queue such that 
> AdminCC's will receive a copy of the text in the opening transaction?
> 
> Here is the scrip information.  I've reviewed the contributions page and 
> read what I can before asking this question.  Thanks for the help.
> 
> Condition:  On Create
> Action: User Defined
> Template: Global template: Blank
> Stage: Transaction Create
> 
> Custom condition: <empty>
> Custom action preparation code: return 1;
> Custom action cleanup code:
> 
> my $owner_id = $self->TicketObj->Owner;
> my $requestor_email = $self->TicketObj->RequestorAddresses;
> my $admincclist = $self->TicketObj->AdminCc;
> my @actors = ('fred at company.com', 'wilma at company.com');
> my $user = RT::User->new($RT::SystemUser);
> 
> if ( $self->TicketObj->Subject =~ m/Customer A/i ) {
>      foreach my $actor (@actors) {
> 	$user->LoadByEmail($actor);
> 	my $user_id = $user->Id;
> 	my $user_email = $user->EmailAddress;
> 	if ( $user_email ne $requestor_email )
> 	{
>              my($status, $msg) = $admincclist->AddMember($user->Id);
>              unless( $status ) {
> 		$RT::Logger->warning( "can't add ticket owner as Cc : msg" );
> 		return undef;
>              }
> 	}
>      }
> } else {
>      return 0;
> }
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
> 
> Community help: http://wiki.bestpractical.com
> Commercial support: sales at bestpractical.com
> 
> 
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
> Buy a copy at http://rtbook.bestpractical.com
> 




More information about the rt-users mailing list