Custom AutoReply

Hi,

I am trying to create a custom autoreply that will include this
information:

Submitted under username: %USERNAME%

Your contact email address for updates will be %USERNAME%@domain.com

How would I tell RT to pull the Requestor’s information for me? I am not
a programmer, so please excuse me if this is something quite simple.

Thanks,

Paul

Hi,

How can I pull the requestor’s username and email address out of the
submitted ticket and use it in the auto-reply?

Thanks,

Paul

Paul Porter wrote:

Hi,

How can I pull the requestor’s username and email address out of the
submitted ticket and use it in the auto-reply?
Try next blocks
{ $TransactionObj->CurrentUser->EmailAddress }
and
{ $TransactionObj->CurrentUser->Name }

Hi Ruslan,

I tried your suggestion and this is the error the email requestor
receieves:

AUTOREPLY EMAIL_______

Hello,

blah blah blah

Important Information

Your ticket number is: 106
Submitted under username: Program fragment delivered error ``Can’t call
method “CurrentUser” on an undefined value at template line 15.

Stack:
[template:15]
[/usr/share/request-tracker3/lib/RT/Template_Overlay.pm:384]
[/usr/share/request-tracker3/lib/RT/Template_Overlay.pm:315]
[/usr/share/request-tracker3/lib/RT/Action/SendEmail.pm:210]
[/usr/share/request-tracker3/lib/RT/ScripAction_Overlay.pm:199]
[/usr/share/request-tracker3/lib/RT/Scrip_Overlay.pm:402]
[/usr/share/request-tracker3/lib/RT/Scrip_Overlay.pm:345]
[/usr/share/request-tracker3/lib/RT/Scrips_Overlay.pm:196]
[/usr/share/request-tracker3/lib/RT/Transaction_Overlay.pm:118]
[/usr/share/request-tracker3/lib/RT/Ticket_Overlay.pm:3810]
[/usr/share/request-tracker3/lib/RT/Ticket_Overlay.pm:629]
[/usr/share/request-tracker3/lib/RT/Interface/Email.pm:669]
[/usr/share/request-tracker3/html/REST/1.0/NoAuth/mail-gateway:31]’’

Your contact email address for updates will be:

Program fragment delivered error ``Can’t call method “Requestors” on an
undefined value at template line 19.

Stack:
[template:19]
[/usr/share/request-tracker3/lib/RT/Template_Overlay.pm:384]
[/usr/share/request-tracker3/lib/RT/Template_Overlay.pm:315]
[/usr/share/request-tracker3/lib/RT/Action/SendEmail.pm:210]
[/usr/share/request-tracker3/lib/RT/ScripAction_Overlay.pm:199]
[/usr/share/request-tracker3/lib/RT/Scrip_Overlay.pm:402]
[/usr/share/request-tracker3/lib/RT/Scrip_Overlay.pm:345]
[/usr/share/request-tracker3/lib/RT/Scrips_Overlay.pm:196]
[/usr/share/request-tracker3/lib/RT/Transaction_Overlay.pm:118]
[/usr/share/request-tracker3/lib/RT/Ticket_Overlay.pm:3810]
[/usr/share/request-tracker3/lib/RT/Ticket_Overlay.pm:629]
[/usr/share/request-tracker3/lib/RT/Interface/Email.pm:669]
[/usr/share/request-tracker3/html/REST/1.0/NoAuth/mail-gateway:31]’’

END EMAIL_

This is what a portion of my template looks like:

Your ticket number is: {$Ticket->id()}
Submitted under username: { $TransactionObj->CurrentUser->Name }

Your contact email address for updates will be:

{ $TransactionObj->CurrentUser->EmailAddress }

You can access this ticket any time at:

http://xxx.vicor.com/rt/Ticket/Display.htm.?id={$Ticket->id}

(Note: This page requires you to log in with the username you used
to create the ticket.)

{
*RT::User::GenerateRandomNextChar = &RT::User::_GenerateRandomNextChar;

if (($Transaction->CreatorObj->id != $RT::Nobody->id) &&

(!$Transaction->CreatorObj->Privileged) &&
($Transaction->CreatorObj->__Value('Password') eq '*NO-PASSWORD*')
) {

    my $user = RT::User->new($RT::SystemUser);
    $user->Load($Transaction->CreatorObj->Id);
    my ($stat, $pass) = $user->SetRandomPassword();

    if (!$stat) {
            $OUT .=

“An internal error has occurred. RT was not able to set a password for
you.
Please contact your local RT administrator for assistance.”;

    }

$OUT .= "

****** NEW USER PASSWORD SETUP *******

  •                                *
    
  • Please use the following username *
  • and password to login to the Vicor *
  • IT Department RT System: *
  •                                *
    
  •   Username: ".$user->Name."    *
    
  •   Password: ".$pass."          *
    
  •                                *
    

";
}
}

END__

Thanks again,

  • PaulOn Mon, 2004-10-18 at 01:07, Ruslan U. Zakirov wrote:

Paul Porter wrote:

Hi,

How can I pull the requestor’s username and email address out of the
submitted ticket and use it in the auto-reply?
Try next blocks
{ $TransactionObj->CurrentUser->EmailAddress }
and
{ $TransactionObj->CurrentUser->Name }

Thanks,

Paul


http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Be sure to check out the RT wiki at http://wiki.bestpractical.com

I’m terribly sorry. It’s my fault. Change ‘TransactionObj’ to ‘Transaction’.

Paul Porter wrote:

I probably did something wrong,

I tried to implement 1 of the suggest line and I did not get the greeting that I wanted. Below is a snip of the autoreply template…

Greetings { $Transaction->CurrentUser->Name },

This message has been automatically generated in response to the
creation of a trouble ticket regarding:
"{$Ticket->Subject()}",
a summary of which appears below.

The result came out as …

Greetings RT_System,

This message has been automatically generated in response to the creation of a trouble ticket regarding:
“COLLECTSVR/Data Disk E Used above 85% for 15 min.”,
a summary of which appears below.

-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-
bounces@lists.bestpractical.com] On Behalf Of Ruslan U. Zakirov
Sent: Tuesday, October 19, 2004 12:32 AM
To: Paul Porter
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Custom AutoReply

I’m terribly sorry. It’s my fault. Change ‘TransactionObj’ to
’Transaction’.

Paul Porter wrote:

Hi Ruslan,

I tried your suggestion and this is the error the email requestor
receieves:

This electronic mail message contains information belonging to PaymentOne, which may be confidential and/or legal privileged. The information is intended only for the use of the individual or entity named above. If you are not the intended recipient, you are hereby notified that any disclosure, printing, copying, distribution, or the taking of any action in reliance on the contents of this electronically mailed information is strictly prohibited. If you receive this message in error, please immediately notify us by electronic mail and delete this message.