[rt-users] sending mail from scrip action
Kevin Falcone
falcone at bestpractical.com
Mon Aug 27 12:13:08 EDT 2012
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20120827/8715420e/attachment.sig>
More information about the rt-users
mailing list