Edit Correspondence in HTML Template

I would like to add some custom fields to all correspondence templates. Can anyone tell me what lines to add to include CustomField.{Location} and CustomField.{Room}

I was able to copy some default information from Transaction in HTML Template to edit/add to the Correspondence in HTML Template. My supervisor would like more information to be shown.

I attempted to add this below but I think the }} didn’t work, got Couldn’t compile template codeblock ‘Location’: Bareword “Location” not allowed while “strict subs” in use at template line 10

CustomField.{Location}: {$Ticket->CustomField.{Location}}

When you put something inside of { } brackets the template executes that as Perl code, so you most likely want:

Location: {$Ticket->FirstCustomFieldValue('Location')}

I will give it a try, thanks. I know that is how it shows up in the add additional fields so that is why I used that.

Couldn’t compile template codeblock ‘$Ticket->CustomField.(Location)’: Bareword “Location” not allowed while “strict subs” in use at template line 10

It did allow me to save but it did not send an email, I go the error The RT System itself - Sending the previous mail has failed. Please contact your admin, they can find more details in the logs.

I added this line: Location:{$Ticket->FirstCustomFieldValue(‘Location’)}

If you up your log level you get more information about the error, make sure you didn’t copy and paste that code as there are smart quotes around Location which will cause errors.

Added this line: Location:{$Ticket->FirstCustomFieldValue(Location)}

I realize now that all the HTML tags don’t show up in the ticket. Pasted now as plain text. Got same error Couldn’t compile template codeblock ‘$Ticket->FirstCustomFieldValue(Location)’: Bareword “Location” not allowed while “strict subs” in use at template line 10

You need to quote location

Location: {$Ticket->FirstCustomFieldValue'Location'}

Couldn’t compile template codeblock ‘$Ticket->FirstCustomFieldValue’Location’’: Can’t find string terminator “’” anywhere before EOF at template line 10

You still need the brackets as well

$Ticket->FirstCustomFieldValue(‘Location’)

That worked, thanks. I swear I already tried that. Do I use FirstCustomFieldValue for any custom field I have?

yes, the sauce should work for all custom fields

Thank you so much, have a great weekend!