Lines 160-165
sub enqueue {
Link Here
|
160 |
my $metadata = _metadata($letter); |
160 |
my $metadata = _metadata($letter); |
161 |
my $to_address = _to_address($borrower, $transport); |
161 |
my $to_address = _to_address($borrower, $transport); |
162 |
|
162 |
|
|
|
163 |
return if $to_address = -1; |
164 |
|
163 |
# Same as render_metadata |
165 |
# Same as render_metadata |
164 |
my $format ||= sub { $_[0] || "" }; |
166 |
my $format ||= sub { $_[0] || "" }; |
165 |
my $body = join('', map { $format->($_) } @{$metadata->{body}}); |
167 |
my $body = join('', map { $format->($_) } @{$metadata->{body}}); |
Lines 181-196
sub _to_address {
Link Here
|
181 |
if ($transport eq 'email') { |
183 |
if ($transport eq 'email') { |
182 |
$address = $borrower->{email} |
184 |
$address = $borrower->{email} |
183 |
|| $borrower->{emailpro} |
185 |
|| $borrower->{emailpro} |
184 |
|| $borrower->{B_email}; |
186 |
|| $borrower->{B_email} |
|
|
187 |
|| -1; |
185 |
} elsif ($transport eq 'sms') { |
188 |
} elsif ($transport eq 'sms') { |
186 |
$address = $borrower->{smsalertnumber} |
189 |
$address = $borrower->{smsalertnumber} |
187 |
|| $borrower->{phone} |
190 |
|| $borrower->{phone} |
188 |
|| $borrower->{phonepro} |
191 |
|| $borrower->{phonepro} |
189 |
|| $borrower->{B_phone}; |
192 |
|| $borrower->{B_phone} |
|
|
193 |
|| -1; |
190 |
} else { |
194 |
} else { |
191 |
warn "'$transport' is an unknown message transport."; |
195 |
warn "'$transport' is an unknown message transport."; |
192 |
} |
196 |
} |
193 |
if (not defined $address) { |
197 |
if ($address == -1) { |
194 |
warn "An appropriate $transport address " |
198 |
warn "An appropriate $transport address " |
195 |
. "for borrower $borrower->{userid} " |
199 |
. "for borrower $borrower->{userid} " |
196 |
. "could not be found."; |
200 |
. "could not be found."; |
197 |
- |
|
|