[rt-users] Custom template/scrip with conditional responses

Joe Harris drey111 at gmail.com
Tue Jun 12 10:43:18 EDT 2012


Is there a way in templates to build one with a conditional response
based on transaction type? (4.0.5)

Example:

I have a template for owner change which works well.  On owner change
notify of change adds the new owner in the subject like so:
Subject: Owner change: {$Ticket->OwnerObj->Name}: {$Ticket->Subject}

{$Transaction->CreatedAsString}: Request {$Ticket->id} was acted upon.
 Transaction: {$Transaction->Description}
       Queue: {$Ticket->QueueObj->Name}
     Subject: {$Transaction->Subject || $Ticket->Subject ||
{$Ticket->OwnerObj->Name} || "(No subject given)"}
       Owner: {$Ticket->OwnerObj->Name}
  Requestors: {$Ticket->RequestorAddresses}
      Status: {$Ticket->Status}
 Ticket URL: {RT->Config->Get('WebURL')}Ticket/Display.html?id={$Ticket->id}
 Mobile URL: {RT->Config->Get('WebURL')}m/ticket/history?id={$Ticket->id}


What I would like is to have one like that for Status change, but I
don't want the users to get multiple emails on the same transaction.
So if I could what an if statement around the subject line to
determine what the change was and use one template for multiple
purposes.

If owner changes -> Show new owner in subject
If status change -> Show new status in subject
and/or even if both conditions, add both.

Is this even possible?

Thanks in advance for any insight!

Joe



More information about the rt-users mailing list