[rt-users] HTML template correspondence (possible bug)

Hoogstraten, Ton Ton.Hoogstraten at ingram.nl
Tue Sep 16 07:21:54 EDT 2008


Jesse,

 

I'm not sure if the following should be reported as a bug in rt 3.8.1.
In my search for HTML response in correspondence messages I tried the
following that resulted in a stack trace.

 

My Perl skills are limited, so I might not see/do this correct. I tried
setting the 'Content-Type: text/html' in the Correspondence template.
I'm basing this idea on the following code in /lib/RT/Action/SendMail.pm
that should allow you to parse 'text/html' to $type.

 

# For security reasons, we only send out textual mails.

    foreach my $part ( grep !$_->is_multipart, $MIMEObj->parts_DFS ) {

        my $type = $part->mime_type || 'text/plain';

        $type = 'text/plain' unless
RT::I18N::IsTextualContentType($type);

        $part->head->mime_attr( "Content-Type"         => $type );

        $part->head->mime_attr( "Content-Type.charset" => 'utf-8' );

 

If I then check the IsTextualContentType function:

 

sub IsTextualContentType {

    my $type = shift;

    ($type =~ m{^(?:text/(?:plain|html)|message/rfc822)\b}i) ? 1 : 0;

}

 

It should be able to return true on ContentType 'text/html'. RT however
generates a stack strace when opening Update.html and is not sending the
mail when submitted. If I remove the 'ContentType: text/html' line from
the Template all is ok and the system works normally again. See included
attachment for the stack trace

 

Regards,

 

Ton

 

 

From: Jesse Vincent [mailto:jesse at bestpractical.com] 
Sent: maandag 15 september 2008 17:00
To: Hoogstraten, Ton
Cc: rt-users at lists.bestpractical.com
Subject: Re: [rt-users] HTML template correspondence

 

 

On Sep 15, 2008, at 9:56 AM, Hoogstraten, Ton wrote:





Hi Jesse,

 

I have a test conversion of our production setup running. I'm not
getting the responses in HTML if I type a message in richt text in the
editor. Am I missing a specific setting that needs to be enabled?

 

It's worth having a look at the message another user replied with. There
are still some nits. There may be a patch sitting in our RT that you'll
want to apply.

 

-jesse





 

Thank you,

 

Ton

 

From: Jesse Vincent [mailto:jesse at bestpractical.com] 
Sent: maandag 15 september 2008 15:52
To: Hoogstraten, Ton
Cc: rt-users at lists.bestpractical.com
Subject: Re: [rt-users] HTML template correspondence

 

 

On Sep 15, 2008, at 9:48 AM, Hoogstraten, Ton wrote:






Hi,

 

I'm receiving requests from users if it is possible to have RT
correspond in HTML enabled mail messages instead of plain text.  Is this
possible with RT? The idea is that they eventually would like to be able
to use the company logo in the mail.

 

As it happens, yes. RT 3.8 makes this possible :)

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20080916/3dd35a86/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rt.stack
Type: application/octet-stream
Size: 2564 bytes
Desc: rt.stack
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20080916/3dd35a86/attachment.obj>


More information about the rt-users mailing list