https://rt-wiki.bestpractical.com/index.php?title=AnyTransactionSource&feed=atom&action=historyAnyTransactionSource - Revision history2024-03-28T20:15:57ZRevision history for this page on the wikiMediaWiki 1.37.2https://rt-wiki.bestpractical.com/index.php?title=AnyTransactionSource&diff=26331&oldid=prevTharn at 18:15, 13 August 20162016-08-13T18:15:33Z<p></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 14:15, 13 August 2016</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l19">Line 19:</td>
<td colspan="2" class="diff-lineno">Line 19:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>2. Save the following code in a datafile named AnyTransactionSource.insert on your server. In this context, "internal" means "staff" and "external" means "customers":</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>2. Save the following code in a datafile named AnyTransactionSource.insert on your server. In this context, "internal" means "staff" and "external" means "customers":</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"><pre></ins></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> @ScripConditions = (</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> @ScripConditions = (</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> { Name =&gt; 'On Create External',</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> { Name =&gt; 'On Create External',</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l45">Line 45:</td>
<td colspan="2" class="diff-lineno">Line 46:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> },</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> },</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> );</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> );</div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></pre></ins></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>3. Run the RT3 Setup Database tool specifying to insert the datafile just saved. This will create the ScripConditions in RT's database.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>3. Run the RT3 Setup Database tool specifying to insert the datafile just saved. This will create the ScripConditions in RT's database.</div></td></tr>
<!-- diff cache key bestpractical_mediawiki1459887241:diff::1.12:old-169:rev-26331 -->
</table>Tharnhttps://rt-wiki.bestpractical.com/index.php?title=AnyTransactionSource&diff=169&oldid=prevAdmin: 3 revisions imported2016-04-06T20:03:14Z<p>3 revisions imported</p>
<p><b>New page</b></p><div>== Overview ==<br />
<br />
In addition to using RT to receive requests from customers, we also use it to send notices or requests to customers and vendors. This gives us a complete log of both incoming and outgoing communications.<br />
<br />
The problem is that RT by default isn't designed to make outgoing e-mail easy. In the default state one must create a ticket then reply to it to get the correspondence sent to the requestor (who is the customer/vendor you want to send mail to). There is also the problem of autoreplies upon ticket creation.<br />
<br />
These problems are easily resolved by using the AnyTransactionSource ScripCondition provided by Florian Weimer and the RUS-CERT team at University of Stuttgart.<br />
<br />
You can find Florian Weimer's posting describing AnyTransactionSource in the mailing list archives here: http://lists.bestpractical.com/pipermail/rt-users/2003-January/011567.html<br />
<br />
I have spent some time implementing this in our RT3 installation and have documented the steps required as I wasn't able to find any previous documentation on the subject for RT3.<br />
<br />
== How to set up AnyTransactionSource in RT3: ==<br />
<br />
1. Copy the [https://git.netways.org/?p=rt3-modules.git;a=blob_plain;f=RTx-MiscScrips/lib/RT/Condition/AnyTransactionSource.pm;h=81d90795ca85b9e2c451dd4507c828e438b2b952;hb=763d62db092bfeaff9ea63e19cbcd17083560578 AnyTransactionSource.pm] ScripCondition (courtesy [https://www.netways.org/ NETWAYS] ) to your local RT3 customizations area:<br />
<br />
/path/to/rt3/local/lib/RT/Condition/!AnyTransactionSource.pm<br />
<br />
2. Save the following code in a datafile named AnyTransactionSource.insert on your server. In this context, "internal" means "staff" and "external" means "customers":<br />
<br />
@ScripConditions = (<br />
{ Name =&gt; 'On Create External',<br />
Description =&gt; 'When a ticket is created externally',<br />
ExecModule =&gt; 'AnyTransactionSource',<br />
Argument =&gt; 'external',<br />
ApplicableTransTypes =&gt; 'Create'<br />
},<br />
{ Name =&gt; 'On Create Internal',<br />
Description =&gt; 'When a ticket is created internally',<br />
ExecModule =&gt; 'AnyTransactionSource',<br />
Argument =&gt; 'internal',<br />
ApplicableTransTypes =&gt; 'Create'<br />
},<br />
{ Name =&gt; 'On Correspond External',<br />
Description =&gt; 'Whenever external correspondence comes in',<br />
ExecModule =&gt; 'AnyTransactionSource',<br />
Argument =&gt; 'external',<br />
ApplicableTransTypes =&gt; 'Correspond'<br />
},<br />
{ Name =&gt; 'On Correspond Internal',<br />
Description =&gt; 'Whenever internal correspondence comes in',<br />
ExecModule =&gt; 'AnyTransactionSource',<br />
Argument =&gt; 'internal',<br />
ApplicableTransTypes =&gt; 'Correspond'<br />
},<br />
);<br />
<br />
3. Run the RT3 Setup Database tool specifying to insert the datafile just saved. This will create the ScripConditions in RT's database.<br />
<br />
/path/to/rt3/sbin/rt-setup-database --action insert --datafile /path/to/AnyTransactionSource.insert<br />
<br />
4. Change your existing On Create autoreply scrip to use the "On Create External" condition instead of the "On Create" condition it currently uses.<br />
<br />
<br />
<br />
5. Add a new scrip:<br />
<br />
Condition: On Create Internal<br />
Action: Notify Requestors and Ccs<br />
Template: Correspondence<br />
<br />
When finished, tickets created externally by your users, will still receive the auto reply. Tickets created internally by your staff will automatically send the message entered as correspondence to the requestor specified. The "requestor" will not receive an auto reply.<br />
<br />
<br />
<br />
Contributed by [[BillGerrard]]<br />
<br />
== Note ==<br />
<br />
You cannot use this to distinguish if a ticket has been created via e-mail or via the [[SelfService]] interface. For that see [[OnWebCorrespond]].<br />
<br />
[http://cert.uni-stuttgart.de/projects/rt/snippets/Action/AnyTransactionSource.pm The original AnyTransactionSource.pm]<span style="font-style: normal; "> seems to have vanished; thanks to [https://www.netways.org/ NETWAYS] for having a copy in their git repository.</span><br />
<br />
See also [[OnCreateFromEmail]].</div>Admin