Custom template/scrip with conditional responses

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:

{$Transaction->CreatedAsString}: Request {$Ticket->id} was acted upon.
Transaction: {$Transaction->Description}
Queue: {$Ticket->QueueObj->Name}
{$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

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

RT’s Templates are just Text::Template, you can read more about the
syntax at Text-Template-1.61 - Expand template text with embedded Perl - metacpan.org
You can absolutely say Subject: { if (blah blah blah) { } else {} }
There is more about the particular syntax of RT’s templates available
in docs/customiziing/templates.pod

-kevin