How to customize attaching a message

I can not figure how to customize the behaving of RT-Attach-Message in a Template. I need something like:

{ if ($Transaction->Attachments->First->GetHeader('RT-DetectedAutoGenerated') eq ('true') ) {RT-Attach-Message: no}
 else {RT-Attach-Message: yes}    }

and so far have no success. Does anybody know? :slight_smile:
Thank you, Petr

OK, if anybody needs it, here it is. The key is not to customize the whole header but only it’s content:

RT-Attach-Message: {
    if ($Transaction->Attachments->First->GetHeader('RT-DetectedAutoGenerated') eq ("true") ) {"no"}
    else {"yes"}
1 Like

Hi Petr.
What do you get with that code in the template.

Is the attachment added to the ticket closing response?

Hi, this code puts on the first line of the template either
“RT-Attach-Message: yes” or “RT-Attach-Message: no”. So depending on the value the attachment is added or not. This template is not for the closing response as it reacts on auto generated messages.