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

2012-01-23 Thread Thomas Sibley
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

RT Training Sessions (http://bestpractical.com/services/training.html)
* Boston  March 5  6, 2012


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

2012-01-19 Thread Brent Wiese
 On Wed, Jan 18, 2012 at 04:33:20PM -0700, Brent Wiese wrote:
 My assumption is I would need to build a new template. What I
 can't figure out is the code
 that goes in the template so the text I'm adding isn't just parsed
 as the message content
 itself.
 
 
 You may want to review the docs/customizing/templates.pod included with
 RT, which also talks about how to set a custom header type.
 
 You won't be able to build an attachment from your Template, so
 hopefully an inline solution works.
 
 -kevin

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.

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...

In my case, I actually don't need any readable message content outside of that 
Content-Type...

Thanks,
Brent

RT Training Sessions (http://bestpractical.com/services/training.html)
* Boston  March 5  6, 2012