Add an option to create, to not make emails.
This commit is contained in:
parent
12de18502a
commit
9231eb9f46
1 changed files with 20 additions and 8 deletions
|
|
@ -97,12 +97,22 @@ Email message to use rather than inbox message contents.
|
||||||
|
|
||||||
Email subject to use rather than inbox message subject.
|
Email subject to use rather than inbox message subject.
|
||||||
|
|
||||||
|
=head3 options
|
||||||
|
|
||||||
|
A hash reference containing options for handling the message.
|
||||||
|
|
||||||
|
=head4 testing
|
||||||
|
|
||||||
|
If testing is true, then no email will be made or sent. Only
|
||||||
|
the inbox message will be made.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub create {
|
sub create {
|
||||||
my $class = shift;
|
my $class = shift;
|
||||||
my $session = shift;
|
my $session = shift;
|
||||||
my $properties = shift;
|
my $properties = shift;
|
||||||
|
my $options = shift || {};
|
||||||
my $self = {};
|
my $self = {};
|
||||||
$self->{_properties}{messageId} = "new";
|
$self->{_properties}{messageId} = "new";
|
||||||
$self->{_properties}{status} = $properties->{status} || "pending";
|
$self->{_properties}{status} = $properties->{status} || "pending";
|
||||||
|
|
@ -149,11 +159,13 @@ sub create {
|
||||||
}
|
}
|
||||||
|
|
||||||
my $subject = (defined $properties->{emailSubject}) ? $properties->{emailSubject} : $self->{_properties}{subject};
|
my $subject = (defined $properties->{emailSubject}) ? $properties->{emailSubject} : $self->{_properties}{subject};
|
||||||
my $mail = WebGUI::Mail::Send->create($session, {
|
my $mail = $options->{testing}
|
||||||
toUser=>$self->{_properties}{userId},
|
? undef
|
||||||
toGroup=>$self->{_properties}{groupId},
|
: WebGUI::Mail::Send->create($session, {
|
||||||
subject=>$subject,
|
toUser=>$self->{_properties}{userId},
|
||||||
});
|
toGroup=>$self->{_properties}{groupId},
|
||||||
|
subject=>$subject,
|
||||||
|
});
|
||||||
if (defined $mail) {
|
if (defined $mail) {
|
||||||
my $preface = "";
|
my $preface = "";
|
||||||
my $fromUser = WebGUI::User->new($session, $properties->{sentBy});
|
my $fromUser = WebGUI::User->new($session, $properties->{sentBy});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue