<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Sep 13, 2013 at 9:16 PM, Landon Stewart <span dir="ltr"><<a href="mailto:lstewart@iweb.com" target="_blank">lstewart@iweb.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div style="font-family:arial,sans-serif;font-size:13px">
This was originally posted to the RTIR list but I'm x-posting it here because it's not specific to RTIR and I'm still having difficulties.</div>

<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">I've been unable to figure out how to call an action module from another action module but instead I've been working on an action module that basically:</div>


<div style="font-family:arial,sans-serif;font-size:13px">- gets called on an Incident (and uses the create and correspond transactions to open a new Investigations ticket)</div><div style="font-family:arial,sans-serif;font-size:13px">


- attaches the Incident Reports linked to that Incident to the Investigation…</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">I have it creating a ticket although I haven't filled in much of the CustomFields I'll need to I cannot get it to use a template for some reason.  </div>


<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Specifically the LoadQueueTemplate() and Parse() a bit of a mystery to me.  </div><div style="font-family:arial,sans-serif;font-size:13px">


<br></div><div style="font-family:arial,sans-serif;font-size:13px">Example:</div><div style="font-family:arial,sans-serif;font-size:13px"><div>    $templateObj->LoadQueueTemplate( Queue => "Investigations", Name => $classification." (en)" );</div>


<div>    my($ret, $msg) = $templateObj->Parse( TicketObj => $new_ticket, TransactionObj => $self->TransactionObj );</div></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div></div></blockquote>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div style="font-family:arial,sans-serif;font-size:13px">
</div><div style="font-family:arial,sans-serif;font-size:13px">

I am building a MIME::Entity above this called $MIMEObj including all the attachments etc but I don't understand how to get Parse() to to "do something" to the MIMEObj to get the MIME::Entity->build( Data => … ) to use the template.  Also the attachments are coming out in-line in the message instead of attachments but that's probably because the "RT-Attach-Message: yes" header is in the template that's not being used if I'm understanding the use of that header correctly.</div>
</div></blockquote><div><br></div><div>You should go other way around. After calling $template->Parse you call $template->MIMEObj and get MIME::Entity representing result of the template. You then can update this entity with attachments, more headers and so on.</div>
<div><br></div><div><span style="font-family:arial,sans-serif;font-size:13px">RT-Attach-Message: yes header is checked by notification scrip, so it should be in notification template, not in template which you use to generate content.</span><br>
</div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr">

<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">A more full representation of the code is here:</div><div style="font-family:arial,sans-serif;font-size:13px">


<a href="http://pastebin.com/QF2tbZqH" target="_blank">http://pastebin.com/QF2tbZqH</a><br></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">


Thanks to anyone who has an idea of what I'm missing or doing wrong here and might have some ideas for me.</div><span class=""><font color="#888888"><div><br></div>-- <br><div dir="ltr"><div><span style="font-family:arial;font-size:small">Landon Stewart :: </span><a href="mailto:lstewart@iweb.com" style="font-family:arial;font-size:small" target="_blank">lstewart@iweb.com</a><br>


</div><span style="font-family:arial;font-size:small">Lead Specialist, Abuse and Security Management</span><br style="font-family:arial;font-size:small"><span style="font-family:arial;font-size:small">Spécialiste principal, gestion des abus et sécurité</span><br style="font-family:arial;font-size:small">


<span style="font-family:arial;font-size:small"><a href="http://iweb.com" target="_blank">http://iweb.com</a> :: +1 (888) 909-4932</span><br><div><span style="font-family:arial;font-size:small"><br></span></div><div><span style="font-family:arial;font-size:small"><br>


</span></div></div>
</font></span></div>
<br><br>
--<br>
RT Training in New York, October 8th and 9th: <a href="http://bestpractical.com/training" target="_blank">http://bestpractical.com/training</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Best regards, Ruslan.
</div></div>