[rt-users] Send Notify except if Owner Nobody?

Jean-Sebastien Morisset jsmoriss at mvlan.net
Mon Mar 3 10:20:00 EST 2008


Arg! This is really frustrating. Using examples found here and there, I
tried this, but it doesn't work...

---BEGIN-TEMPLATE---
{
  my ($to, $for, $msg);
  if ($Ticket->OwnerObj->Name eq "Nobody") {
    $to = "support-unix at m-x.ca";
  } else {
    $to = $Ticket->OwnerObj->EmailAddress;
    $for = " for ".$Ticket->OwnerObj->Name;
  }
  $msg .= To: $to\n";
  $msg .= "Subject: $Ticket->QueueObj->Name() Queue $for:
$Ticket->Subject()\n\n";
  $msg =. "Ticket #$Ticket->id $for has been added to the
$Ticket->QueueObj->Name() queue.\n";
  $msg;
}

-> Ticket URL: {$RT::WebURL}Ticket/Display.html?id={$Ticket->id}

{$Transaction->Content()}
---END-TEMPLATE---

Does anyone see where the problem might be?...

Thanks!
js.

On Mon, Mar 03, 2008 at 01:43:17PM +0000, Jean-Sebastien Morisset wrote:
> Hi everyone,
> 
> I know there's a way to do this, but I'm still learning RT, so I don't
> know exactly how to code this... I'd like to send an e-mail for a new
> ticket to a group, if the owner is Nobody, and send it to the owner if
> the owner is NOT Nobody. Right now I have a generic e-mail scrip...
> 
> The scrip:
>     On Create Send Email with template Added to Queue Email
> 
> The template (Added to Queue Email):
>     To: group-list at company.com
>     Subject: {$Ticket->QueueObj->Name()} Queue: {$Ticket->Subject()}
> 
>     Ticket #{$Ticket->id} has been added to the {$Ticket->QueueObj->Name()} queue.
> 
>     -> Ticket URL: {$RT::WebURL}Ticket/Display.html?id={$Ticket->id}
> 
>     {$Transaction->Content()}
> 
> 
> So I guess I'm looking to change the template to something like:
> 
> ---BEGIN---
> if owner eq Nobody {
>     To: group-list at company.com
>     Subject: {$Ticket->QueueObj->Name()} Queue: {$Ticket->Subject()}
> 
>     Ticket #{$Ticket->id} has been added to the {$Ticket->QueueObj->Name()} queue.
> } else {
>     To: owner->email
>     Subject: Your Ticket in {$Ticket->QueueObj->Name()} Queue: {$Ticket->Subject()}
> 
>     Ticket #{$Ticket->id} has been added to the {$Ticket->QueueObj->Name()} queue and assigned to you.
> }
> 
> -> Ticket URL: {$RT::WebURL}Ticket/Display.html?id={$Ticket->id}
> 
> {$Transaction->Content()}
> ---BEGIN---
> 
> What do you think?
> 
> Thanks!
> js.
> -- 
> Jean-Sebastien Morisset, Sr. UNIX Administrator <jsmoriss at mvlan.net>
> Community help: http://wiki.bestpractical.com
> Commercial support: sales at bestpractical.com
> 
> 
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
> Buy a copy at http://rtbook.bestpractical.com
> 

-- 
Jean-Sebastien Morisset, Sr. UNIX Administrator <jsmoriss at mvlan.net>



More information about the rt-users mailing list