[rt-users] stripping HTML

Eleanor J. Evans [Panix Staff] eje at panix.com
Thu Dec 24 12:34:44 EST 2009


I've got a scrip & template that saves comments or correspondence to a
customer's e-mail archive.  I'd like to save the messages as
text/plain instead of text/html.  I'm working in a 3.8.5 installation
that's been patched to 3.8.7.

I want to strip the HTML from messages posted via the web.  There must
be an elegant RT way to do it, since that's how RT sends its e-mail
for those transactions.

Here's the relevant snippet of my template:

{$headers = $Transaction->Attachments->Next->Headers();
$headers .= "\nFrom: " . $Transaction->Attachments->Next->CreatorObj->EmailAddress unless $headers =~ m/^From: /m;
$headers .= "\nTo: " . $Ticket->QueueObj->CorrespondAddress unless $headers =~ m/^To: /m;
$headers}

{$Transaction->Attachments->Next->Content()}

Should I be trying to call AddAttachments here, or something?  Any
pointers much appreciated.  Thanks.


-- 
Eleanor J. (Piglet) Evans, eje at panix.com
Customer Support, (212) 741-4400



More information about the rt-users mailing list