Convert old scrip/template to HTML

Hello,

I have old scrip since 3.x that is notifying group of users that are associated with particular queue. Only one thing in modern day is missing - if there are attachements with images or pasted images inline, this notification is not displaying it.

Subject: Nowy ticket pojawił się w kolejce {$Ticket->QueueObj->Name} : {$Ticket->Subject}
To: { my $group = RT::Group->new( $RT::SystemUser ); $group->LoadUserDefinedGroup("NAME_OF_GROUP"); $group->MemberEmailAddressesAsString; }

 
 Nowy ticket pojawił się w kolejce {$Ticket->QueueObj->Name}.
 
        Temat: {$Transaction->Subject || $Ticket->Subject || "(No subject given)"}
  Zgłaszający: {$Ticket->RequestorAddresses}
  Ticket <URL: {$RT::WebURL}Ticket/Display.html?id={$Ticket->id} >
 
Treść zgłoszenia:

{ $Ticket->Transactions->First->Content; }

I tried to convert it to HTML template and I came with this below. But when applied - notification is not sent, and what is worst ticket is not registered.

Maybe something more is needed perl-wise to actually convert text template to html, but thats a knowledge that I’m lacking.

Thanks in advance.

RT-Attach-Message: yes
Content-Type: text/html

Subject: Nowy ticket pojawił się w kolejce {$Ticket->QueueObj->Name} : {$Ticket->Subject}
To: { my $group = RT::Group->new( $RT::SystemUser ); $group->LoadUserDefinedGroup("NAME_OF_GROUP"); $group->MemberEmailAddressesAsString; }

 
 Nowy ticket pojawił się w kolejce {$Ticket->QueueObj->Name}.
 
        Temat: {$Transaction->Subject || $Ticket->Subject || "(No subject given)"}
  Zgłaszający: {$Ticket->RequestorAddresses}
  Ticket <URL: {$RT::WebURL}Ticket/Display.html?id={$Ticket->id} >
 
Treść zgłoszenia:

{ $Ticket->Transactions->First->Content(Type => "text/html") }

Any errors appearing in your log files? That’s usually the first place to check if a scrip is blowing up (though I’d still expect the ticket to be generated, as that’s made before the scrips are run).

Right, ticket not registered was due to permission issues, this is fixed. However my changed scrip is producing error:

Aug  3 12:46:32 u-SYS-rt01 RT: [5009] <rt-5.0.3-5009-1659523592-305.2272-24-0@example.com> #2272/54178 - Scrip 24 Powiadomienie o nowym Tickecie 
Aug  3 12:46:32 u-SYS-rt01 RT: [5009] <rt-5.0.3-5009-1659523592-305.2272-24-0@example.com> No recipients found. Not sending.

When I change it to how it was before, scrip can find users in group and is sending notify.

Try removing the blank line between the Content-type and Subject. Those should both be email headers and a line break like that indicates the end of the headers (so your Subject and To are in the body of the email, not the header).

Wow, that did the trick (almost). I don’t know if this can be tweaked more. When I sent email with pasted image inside a body of email I’m getting notify now with image as attachement, not presented in mail with notify inline. Not big deal, but would be handy.

That’s been mentioned several times over the years on this forum/mailing list, with some people trying to make patches for older versions of RT. I don’t know if anything ever made it into RT5.x codebase though. We’ve not had to deal with the issue here as our end users have the original email anyway and staff just get the scrip emails to notify them to look in the web UI, where the display of images, etc is (usually!) correct.