|
Lines 1745-1750
sub first_valid_email_address {
Link Here
|
| 1745 |
return $email; |
1745 |
return $email; |
| 1746 |
} |
1746 |
} |
| 1747 |
|
1747 |
|
|
|
1748 |
=head3 message_transport_type_for |
| 1749 |
|
| 1750 |
Given a message transport type, will return the transport type that should be used, |
| 1751 |
including a fallback if needed. |
| 1752 |
|
| 1753 |
my $mtt = $patron->message_transport_type_for('email'); |
| 1754 |
|
| 1755 |
=cut |
| 1756 |
|
| 1757 |
sub message_transport_type_for { |
| 1758 |
my ( $self, $mtt ) = @_; |
| 1759 |
|
| 1760 |
if ( $mtt eq 'email' ) { |
| 1761 |
return 'sms' |
| 1762 |
if C4::Context->preference("FallbackToSMSIfNoEmail") |
| 1763 |
&& $self->smsalertnumber |
| 1764 |
&& !$self->notice_email_address; |
| 1765 |
} |
| 1766 |
|
| 1767 |
return $mtt; |
| 1768 |
} |
| 1769 |
|
| 1748 |
=head3 get_club_enrollments |
1770 |
=head3 get_club_enrollments |
| 1749 |
|
1771 |
|
| 1750 |
=cut |
1772 |
=cut |
|
Lines 2704-2710
sub queue_notice {
Link Here
|
| 2704 |
or ( $mtt eq 'phone' and not $self->phone ) ) |
2726 |
or ( $mtt eq 'phone' and not $self->phone ) ) |
| 2705 |
{ |
2727 |
{ |
| 2706 |
push @{ $return{fallback} }, $mtt; |
2728 |
push @{ $return{fallback} }, $mtt; |
| 2707 |
$mtt = 'print'; |
2729 |
if ( C4::Context->preference("FallbackToSMSIfNoEmail") |
|
|
2730 |
&& $mtt eq 'email' |
| 2731 |
&& $self->smsalertnumber |
| 2732 |
&& !$self->notice_email_address ) |
| 2733 |
{ |
| 2734 |
$mtt = 'sms'; |
| 2735 |
} else { |
| 2736 |
$mtt = 'print'; |
| 2737 |
} |
| 2708 |
} |
2738 |
} |
| 2709 |
next if $mtt eq 'print' && $print_sent; |
2739 |
next if $mtt eq 'print' && $print_sent; |
| 2710 |
$letter_params->{message_transport_type} = $mtt; |
2740 |
$letter_params->{message_transport_type} = $mtt; |