Fixes to support direct email specification in queued messages.
This commit is contained in:
parent
3481b61cd0
commit
c214303007
@ -21,6 +21,7 @@
|
|||||||
#
|
#
|
||||||
package Webperl::Message::Transport::Email;
|
package Webperl::Message::Transport::Email;
|
||||||
|
|
||||||
|
use utf8;
|
||||||
use strict;
|
use strict;
|
||||||
use base qw(Webperl::Message::Transport);
|
use base qw(Webperl::Message::Transport);
|
||||||
use Encode;
|
use Encode;
|
||||||
@ -128,11 +129,25 @@ sub deliver {
|
|||||||
|
|
||||||
# And the recipients
|
# And the recipients
|
||||||
foreach my $recipient (@{$message -> {"recipients"}}) {
|
foreach my $recipient (@{$message -> {"recipients"}}) {
|
||||||
# Skip users who shouldn't get emails
|
my $recip;
|
||||||
next if(!$force && !$self -> use_transport($recipient -> {"recipient_id"}));
|
|
||||||
|
|
||||||
my $recip = $self -> _get_user_email($recipient -> {"recipient_id"})
|
# Is the recipient identified by an ID number? If so, map to an email address
|
||||||
or return $self -> self_error("Recipient email lookup failed: ".$self -> errstr());
|
if($recipient -> {"recipient_id"}) {
|
||||||
|
# Skip users who shouldn't get emails
|
||||||
|
next if(!$force && !$self -> use_transport($recipient -> {"recipient_id"}));
|
||||||
|
|
||||||
|
$recip = $self -> _get_user_email($recipient -> {"recipient_id"})
|
||||||
|
or return $self -> self_error("Recipient email lookup failed: ".$self -> errstr());
|
||||||
|
|
||||||
|
# Is an email address specified directly? Use it if so.
|
||||||
|
} elsif($recipient -> {"email"}) {
|
||||||
|
$recip = $recipient -> {"email"};
|
||||||
|
|
||||||
|
# This should never happen.
|
||||||
|
} else {
|
||||||
|
# IMPOSSIBRU!
|
||||||
|
return $self -> self_error("עזרה, אני נאלצת לעמול במכרות של קידוד");
|
||||||
|
}
|
||||||
|
|
||||||
$to .= "," if($to);
|
$to .= "," if($to);
|
||||||
$to .= $recip;
|
$to .= $recip;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user