[rt-users] Template snippet causes template to silently fail

Matt Zagrabelny mzagrabe at d.umn.edu
Wed Oct 26 17:44:45 EDT 2016


Hey Alex,

On Wed, Oct 26, 2016 at 4:29 PM, Alex Hall <ahall at autodist.com> wrote:
> Hi all,
> 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:

You can see some documentation regarding txns at:

https://docs.bestpractical.com/rt/4.4.1/RT/Transaction.html

> { if (my $transactionCorrespond = $Transaction->correspond) {
> $transactionCorrespond
> } elsif (my $transactionComment = $Transaction->comment) {
> $transactionComment }
> }

# Here is some untested code...

my $type = $Transaction->Type;

# $type now holds "Correspond" or "Comment"

if ($type eq 'Correspond') {
    # do something for correspond
}
elsif ($type eq 'Comment') {
    # do something for comment
}
else {
    # Perhaps this txn is a Create...
}

-m



More information about the rt-users mailing list