https://rt-wiki.bestpractical.com/index.php?title=OnWebCorrespond&feed=atom&action=historyOnWebCorrespond - Revision history2024-03-29T05:22:27ZRevision history for this page on the wikiMediaWiki 1.37.2https://rt-wiki.bestpractical.com/index.php?title=OnWebCorrespond&diff=2452&oldid=prevAdmin: 3 revisions imported2016-04-06T20:15:50Z<p>3 revisions imported</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 16:15, 6 April 2016</td>
</tr>
<!-- diff cache key bestpractical_mediawiki1459887241:diff::1.12:old-2451:rev-2452 -->
</table>Adminhttps://rt-wiki.bestpractical.com/index.php?title=OnWebCorrespond&diff=2451&oldid=prev193.1.228.252: Adding categories2011-04-01T16:07:33Z<p>Adding categories</p>
<p><b>New page</b></p><div>Question - in an OnCorrespond scrip, how can you determine if the reply is from an incoming email message or from the web interface?<br />
<br />
Here's a custom scrip condition that checks for a "Received" header in the message - if there is one, we assume we're dealing with email. If not, it's a reply entered in the web interface.<br />
<br />
This code will cause the scrip to proceed if we're dealing with a web interface reply.<br />
<br />
<nowiki>my $trans = $self-&gt;TransactionObj;<br />
<br />
# OnCorrespond:<br />
return 0 unless $trans-&gt;Type eq "Correspond";<br />
<br />
# Get the message attachment<br />
my $msgattr = $trans-&gt;Message-&gt;First;<br />
<br />
return 1 unless $msgattr; # no message attachment - assume web UI<br />
<br />
return 0 if $msgattr-&gt;GetHeader('Received'); # email message<br />
<br />
return 1;<br />
<br />
</nowiki><br />
<br />
Steve Turner 5/19/05<br />
<br />
See also [[AnyTransactionSource]].<br />
[[Category:RT Condition]]</div>193.1.228.252