HI
I would like to use template to send auto reject messages to users
require RT::Template;
my $template =
RT::Template->new(RT::CurrentUser->new($RT::Nobody));
if (! $template->LoadGlobalTemplate(‘AutoRejectRequest’)){
$RT::Logger->debug(“TEST AutoRejectRequest failed”);
}else {
my $Content = $template->Content;
my $ii = $template->id;
my $des = $template->Description;
$RT::Logger->debug("TEST AutoRejectRequest Content not
defined") if(! defined $Content);
$RT::Logger->debug("TEST AutoRejectRequest:$ii, $des,
$Content ");
}
[Wed May 5 03:53:22 2004] [debug]: TEST AutoRejectRequest Content not
defined (/usr/local/apps/rt-3.0.8//lib/RT/Interface/Email.pm:575)
[Wed May 5 03:53:22 2004] [debug]: TEST AutoRejectRequest:13, ,
(/usr/local/apps/rt-3.0.8//lib/RT/Interface/Email.pm:577)
As yoy can see from the RT log, I get th ID (13) but the content is
empty, How do I get the template content so that I can do
MailError(
To => $ErrorsTo,
Subject => “Could not load a valid user”,
Explanation => $Content,
MIMEObj => $Message,
LogLevel => ‘error’
);
warm regards
Vinita Vigine Murugiah
Email : vinita@cs.mu.oz.au Ph : (03) 8344 1273
I also tried for a long time to do this… without any success.
Can someone help?
SamuelFrom: vinita vigine MURUGIAH [mailto:vinita@cs.mu.OZ.AU]
Sent: Wednesday,05 May,2004 05:58
To: rt-users@lists.bestpractical.com
Subject: [rt-users] use template from lib
HI
I would like to use template to send auto reject messages to users
require RT::Template;
my $template = RT::Template->new(RT::CurrentUser->new($RT::Nobody));
if (! $template->LoadGlobalTemplate('AutoRejectRequest')){
$RT::Logger->debug("TEST AutoRejectRequest failed");
}else {
my $Content = $template->Content;
my $ii = $template->id;
my $des = $template->Description;
$RT::Logger->debug("TEST AutoRejectRequest Content not defined") if(! defined $Content);
$RT::Logger->debug("TEST AutoRejectRequest:$ii, $des, $Content ");
}
[Wed May 5 03:53:22 2004] [debug]: TEST AutoRejectRequest Content not defined (/usr/local/apps/rt-3.0.8//lib/RT/Interface/Email.pm:575)
[Wed May 5 03:53:22 2004] [debug]: TEST AutoRejectRequest:13, , (/usr/local/apps/rt-3.0.8//lib/RT/Interface/Email.pm:577)
As yoy can see from the RT log, I get th ID (13) but the content is empty, How do I get the template content so that I can do
MailError(
To => $ErrorsTo,
Subject => “Could not load a valid user”,
Explanation => $Content,
MIMEObj => $Message,
LogLevel => ‘error’
);
warm regards
Vinita Vigine Murugiah
Email : vinita@cs.mu.oz.au Ph : (03) 8344 1273