<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7650.28">
<TITLE>AW: Re: [rt-users] Scrips: User Defined actions and Templates</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2>Hi gene,<BR>
<BR>
Ich think at the wiki is under contributions some action like sendmail which parses the template for the rest.<BR>
<BR>
-----Original Message-----<BR>
From: rt-users-bounces@lists.bestpractical.com <rt-users-bounces@lists.bestpractical.com><BR>
To: Stephen Turner <sturner@MIT.EDU>; RT Users <rt-users@lists.bestpractical.com><BR>
Sent: Mon Mar 26 18:20:23 2007<BR>
Subject: Re: [rt-users] Scrips: User Defined actions and Templates<BR>
<BR>
Hi Stephen,<BR>
<BR>
How do I get the user-defined action to result in an e-mail so that the<BR>
template is used? The reason I used "launch" in my original post (when<BR>
referring to my templates) is that I've had to embed a bunch of code that<BR>
modifies the ticket into my templates in order to get both an e-mail and<BR>
changes to the ticket in a single step. So they are really programs (in an<BR>
e-mail wrapper) that get launched when the condition is true. I'd prefer<BR>
to put the code in the scrip and let the template just handle formatting<BR>
the mail, but I don't know how to get the custom action to generate an<BR>
e-mail using the template. Is there a command like<BR>
"RT::SendEmailUsingScripTemplate"?<BR>
<BR>
What I've done is probably confusing, but it's like this:<BR>
1. Mail comes in to queue 1. A scrip extracts some data and populates some<BR>
custom fields, sets the priority, and moves the ticket to queue 2.<BR>
2. Ticket enters queue 2. Scrip fires and uses Notify Others action to<BR>
"launch" a template.<BR>
3. Template modifies some fields in the ticket and creates e-mail to action<BR>
address.<BR>
4. Action address does their job and replies to mail with "ok". Scrip in<BR>
queue 2 triggers, modifies some fields in the ticket, moves ticket back to<BR>
queue 1.<BR>
5. Lather, rinse, repeat a couple more times.<BR>
<BR>
What I want to do is take the code that modifies the ticket out of the<BR>
template at step 3 and put it into the scrip at step 2, but I don't know<BR>
how to get the scrip to use the template after making the changes to the<BR>
ticket. I thought that putting the code in the prep code and returning a<BR>
"1" would do it, but nothing happens with the template.<BR>
<BR>
At 06:28 AM 3/26/2007, Stephen Turner wrote:<BR>
>At Friday 3/23/2007 07:34 PM, Gene LeDuc wrote:<BR>
>>Hi All,<BR>
>><BR>
>>I want a scrip to use both a User Defined action and a template. My<BR>
>>understanding is that selecting User Defined for the action means that<BR>
>>the template won't get run. It would be nice to run my "prep" code to<BR>
>>modify a ticket, launch the template, then run my "cleanup" code. Is<BR>
>>there a command that I can put into my custom action that will launch<BR>
>>either an arbitrary template or the one that is in the Template field?<BR>
>><BR>
>>Thanks,<BR>
>>Gene<BR>
><BR>
>Hello Gene,<BR>
><BR>
>You can define a custom (user defined) action and still have it use a<BR>
>template. But the template will just define the content of the email<BR>
>message sent by the action, and so will only come into play if the action<BR>
>results in an email message. There's no way in which a template can be<BR>
>'launched'.<BR>
><BR>
>Steve<BR>
<BR>
<BR>
--<BR>
Gene LeDuc, GSEC<BR>
Security Analyst<BR>
San Diego State University<BR>
<BR>
_______________________________________________<BR>
<A HREF="http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users">http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users</A><BR>
<BR>
Community help: <A HREF="http://wiki.bestpractical.com">http://wiki.bestpractical.com</A><BR>
Commercial support: sales@bestpractical.com<BR>
<BR>
<BR>
Discover RT's hidden secrets with RT Essentials from O'Reilly Media.<BR>
Buy a copy at <A HREF="http://rtbook.bestpractical.com">http://rtbook.bestpractical.com</A><BR>
</FONT>
</P>
</BODY>
</HTML>