<div dir="ltr">Thanks for the suggestions, but I'm still seeing the same exact problem. If I put the code in, the email based on this template fails to send. The log, however, remains absent any error or warning messages around the time of each attempt I make. I'll paste my latest try below, but note that I've tried $Transaction in place of $self->TransactionObj and gotten the same result.<br><br><br><p>Content:<br>{<br>my $transactionType = $self->TransactionObj->Type;<br>if ($transactionType eq 'Correspond') { $self->TransactionObj->Correspond<br>} elsif ($transactionType eq 'Comment') { $self->TransactionObj->Comment<br>} else { "No content to display."<br>}<br>}<br><br><br></p><br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 26, 2016 at 7:52 PM, Landon Stewart <span dir="ltr"><<a href="mailto:lstewart@internap.com" target="_blank">lstewart@internap.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"><span class="">
On Oct 26, 2016, at 2:29 PM, Alex Hall <<a href="mailto:ahall@autodist.com" target="_blank">ahall@autodist.com</a>> wrote:<br>
</span><div>
<blockquote type="cite"><br class="m_-6339499496193594756Apple-interchange-newline">
<div>
<div dir="ltr">
<div><span class="">
<div>Hi all,<br>
</div>
The way our company uses RT, there's no need to distinguish between comments and replies, and users may use either one without realizing the difference. In my new email template, I want to show whichever was set. My template works fine without the two if statements
I'm trying to use, but as soon as I put them in, it fails. The odd thing is that, though the email using the template is never sent, I don't get any errors at all. When I was missing a dollar sign earlier, I got an error--an error not really related to the
dollar sign, but an error. Now, though, I get nothing whatsoever. Here's the snippet:<br>
<br></span><span class="">
{ if (my $transactionCorrespond = $Transaction->correspond) { $transactionCorrespond<br>
} elsif (my $transactionComment = $Transaction->comment) { $transactionComment }<br>
}<br>
<br>
</span></div>
I don't know what's so wrong with that bit of code, but there must be something. I don't really speak Perl, and the only page I've found thus far that enumerates the Transaction object properties isn't overly helpful, so I'm guessing at the properties I need.
Can anyone see what I've done wrong here? Thanks.<br clear="all">
</div>
</div>
</blockquote>
<div><br>
</div>
</div>
Since $Transaction is a thing then $Transaction->correspond is empty since it's not a thing. This is why you'll get no errors.
<div><br>
</div>
<div>Try this:<br>
<div><font face="Courier New">{</font></div>
<div><font face="Courier New"> if ($self->TransactionObj->Type eq 'Correspond') {</font></div>
<div><font face="Courier New"> # something</font></div>
<div><font face="Courier New"> } elsif ($self->TransactionObj->Type eq 'Comment') {</font></div>
<div><font face="Courier New"> # something else</font></div>
<div>
<div><font face="Courier New"> } else {</font></div>
<div><font face="Courier New"> # Not a Comment or Correspond transaction</font></div>
<div><font face="Courier New"> }</font></div>
<div><font face="Courier New">}</font><br>
<div><br class="m_-6339499496193594756webkit-block-placeholder">
</div>
<div>Or something that actually does exactly what your pseudocode does:</div>
<div><font face="Courier New">{ $self->TransactionObj->Type }</font></div>
<div><br>
</div>
<div>I have found these very helpful in the past:</div>
<div><a href="https://rt-wiki.bestpractical.com/wiki/CustomConditionSnippets" target="_blank">https://rt-wiki.bestpractical.<wbr>com/wiki/<wbr>CustomConditionSnippets</a></div>
<div><br>
</div>
<div>
<div style="word-wrap:break-word">
<div style="color:rgb(0,0,0);font-family:Helvetica;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
--<br>
Landon Stewart<br>
Lead Analyst - Abuse and Security Management<br>
INTERNAP ®<br>
📧 <a href="mailto:lstewart@internap.com" target="_blank">lstewart@internap.com</a><br>
🌍 <a href="http://www.internap.com" target="_blank">www.internap.com</a></div>
</div>
</div>
<br>
</div>
</div>
</div>
</div>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div>Alex Hall<br></div>Automatic Distributors, IT department<br></div><a href="mailto:ahall@autodist.com" target="_blank">ahall@autodist.com</a><br></div></div>
</div>