[rt-users] Custom AutoReply

Ruslan U. Zakirov Ruslan.Zakirov at acronis.com
Tue Oct 19 03:32:12 EDT 2004


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:
> 
> _________________________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,
> 
> - Paul
> 
> 
> On 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
>>
> 




More information about the rt-users mailing list