Use user custom field in template

rt 5.2

how would I use a user custom field as a creator obj? i made a custom field to allow us to add job titles to users, and need to use it to add an email sig to the Correspondence in html template.

You can call a custom field value from a ticket with some Perl code wrapped in {} brackets in your email template.

Signature:
{
    $Ticket->FirstCustomFieldValue( 'Some custom field' );
}
1 Like

doesn’t that call ticket custom field?

Oh you want it on the user object, I believe you can use the same method on the CreatorObj so long as you have a valid RT::User object

  • Couldn’t compile template codeblock ‘$CreatorObj->FirstCustomFieldValue(‘Title’) ': Unrecognized character \x{2018}; marked by ← HERE after ieldValue(<-- HERE near column 42 at template line 7

looks like it does’t like that

Invalid character is likely smart quotes, which should be replaced with regular quotes. Also I don’t believe $CreatorObj is defined ahead of time in templates, see:
https://docs.bestpractical.com/rt/5.0.2/customizing/templates.html

You can get it from $Ticket->CreatorObj

1 Like

yeah, i think it was the quotes. thanks. and it’s transaction->creatorobj when working with correspond lol.