[rt-users] Send Mail Scrip problems
Andy Smith
a.smith at ukgrid.net
Sun Mar 15 19:53:01 EDT 2009
Hi,
I am trying to use the example here:
http://wiki.bestpractical.com/view/SendEmailAction
to send emails based on custom conditions. I have this working using
hard coded destination mail addresses but when I try and use the
section in the template as described in the wiki:
To: { my $GroupObj = RT::Group->new($user);
$GroupObj->LoadUserDefinedGroup('Group Name');
$GroupObj->MemberEmailAddressesAsString()}
it doesn't work for me, I see this error in the system messages file:
Mar 16 00:01:52 alpha RT: RT::Users=HASH(0x16b0a97c) was created
without a CurrentUser. Any RT object which is subclass of RT::Base
must be created with a RT::CurrentUser or a RT::User object as the
first argument. (/usr/local/lib/perl5/site_perl/5.8.9/RT/Base.pm:108)
Mar 16 00:01:53 alpha RT: Template parsing error:
RT::Users=HASH(0x16b0a97c) was created without a CurrentUser at
/usr/local/lib/perl5/site_perl/5.8.9/RT/SearchBuilder.pm line 81
RT::SearchBuilder::_Init('RT::Users=HASH(0x16b0a97c)', undef) called
at /usr/local/lib/perl5/site_perl/5.8.9/RT/Users_Overlay.pm line 80
RT::Users::_Init('RT::Users=HASH(0x16b0a97c)', undef) called at
/usr/local/lib/perl5/site_perl/5.8.9/DBIx/SearchBuilder.pm line 93
DBIx::SearchBuilder::new('RT::Users', undef) called at
/usr/local/lib/perl5/site_perl/5.8.9/RT/Group_Overlay.pm line 843
RT::Group::UserMembersObj('RT::Group=HASH(0x16b327ac)') called at
/usr/local/lib/perl5/site_perl/5.8.9/RT/Group_Overlay.pm line 878
RT::Group::MemberEmailAddresses('RT::Group=HASH(0x16b327ac)') called
at /usr/local/lib/perl5/site_perl/5.8.9/RT/Group_Overlay.pm line 899
RT::Group::MemberEmailAddressesAsString('RT::Group=HASH(0x16b327ac)')
called at template line 3 eval 'package Text::Template::GEN2;
; #line 1 template my $GroupObj = RT::Group->new
Mar 16 00:01:53 alpha kernel: oup->new
Can anyone help? What is going wrong? This is on RT 3.8.2,
thanks for any help, Andy.
More information about the rt-users
mailing list