Send Template with external scrip

Hello,

I have an external scrip with this code:

my $template = RT::Template->new($RT::SystemUser);
$template->LoadGlobalTemplate(‘blablabla’);

my $MIMEObj = $template->MIMEObj;
$MIMEObj->head->set(‘To’, $emailTelefonica);

But I view this error “Can’t call method “head” on an undefined value”

Could you help me?

Thank you so much!
Serialnet SL

Hello,

I have an external scrip with this code:

my $template = RT::Template->new($RT::SystemUser);
$template->LoadGlobalTemplate(‘blablabla’);

my $MIMEObj = $template->MIMEObj;
$MIMEObj->head->set(‘To’, $emailTelefonica);

But I view this error “Can’t call method “head” on an undefined value”

you have to first call $template->Parse( Argument => …, TicketObj => …, TransactionObj => …);

then MIMEObj method will return a valid Entity (currently it should
returns undef without first calling Parse).

Yes! It runs!

Thank you so much!On 01/26/2011 02:02 PM, Emmanuel Lacour wrote:

On Tue, Jan 18, 2011 at 04:00:37PM +0100, Iban Cardona i Subiela wrote:

Hello,

I have an external scrip with this code:

my $template = RT::Template->new($RT::SystemUser);
$template->LoadGlobalTemplate(‘blablabla’);

my $MIMEObj = $template->MIMEObj;
$MIMEObj->head->set(‘To’, $emailTo);

But I view this error “Can’t call method “head” on an undefined value”

you have to first call $template->Parse( Argument => …, TicketObj => …, TransactionObj => …);

then MIMEObj method will return a valid Entity (currently it should
returns undef without first calling Parse).


List info: The rt-devel Archives

Serialnet SL