On Sat, Aug 25, 2012 at 03:59:12PM +0200, Gergely Buday wrote: > I would like to send e-mails from the scrip preparation code. I use
First thing - Don't send mail or make changes from the Preparation
stage of a scrip, do it from the commit.
You also don't say what you're trying to do, but trying to invoke
SendEmail from a UserDefined scrip action probably isn't going to work
quite right.
Are you trying to change @ISA from inside the boxes in the Admin UI?
If you actually need to subclass SendEmail (like Notify does) you
almost certainly need to write code on the filesystem and load it in.
If you tell the list what you're trying to do, someone might be able
to point you to a simpler solution.
-kevin
> require RT::Action::SendEmail;
> use strict;
> use vars qw/@ISA/;
> @ISA = qw(RT::Action::SendEmail);
>
> and would like to set
>
> $self->SetTemplate(25);
>
> but against my expectation $self is not the scrip object but
> Action::UserDefined which does not allow setting the template. At the
> end I would send the mail by
>
> @{ $self->{'To'} } = $followerEmail;
> $self->SUPER::Prepare();
> $self->SUPER::Commit();
>
> If I do not set the template, then the ::Prepare call does not work,
> lacking the TemplateObj.
>
> How could I do this properly?
>
> - Gergely
pgpmajm1BM2bI.pgp
Description: PGP signature
