[rt-users] FW: scrip and template to email calendar invite

Thomas Sibley trs at bestpractical.com
Mon Jan 23 13:51:46 EST 2012


On 01/19/2012 05:23 PM, Brent Wiese wrote:
> It looks like the only custom Content-Type is text/html. I can see
> where it looks for that in Template.pm.
> 
> What I need to do is set the Content-Type as: text/calendar;
> charset="utf-8"; method=REQUEST
> 
> I put an elsif in Template.pm to see if I could get it to pass that
> header on like text/html but it's not working.

Yep, that's the wrong place.  The code block you're looking at in
RT::Template is not forcing a content-type, just defaulting differently
based on what's in your template.

> Anyone more entrenched in the code able to point me in the right
> direction? It'd be great if there was some way to just pass the value
> after Content-Type: in the template to the email...

The part that forces text/plain is line 205 in RT::Action::SendEmail
(and calls into RT::I18N::IsTextualContentType).  The restriction to
m{^(?:text/(?:plain|html)|message/rfc822)\b}i dates from 2007, and I
suspect it should be rewritten to allow arbitrary content-types.

Arbitrary content-types can be a problem if you're letting lots of
admins edit templates, but presumably if you're letting them modify
templates, you already have some degree of trust in them.

Thomas



More information about the rt-users mailing list