|
Lines 1949-1954
sub first_valid_email_address {
Link Here
|
| 1949 |
return $email; |
1949 |
return $email; |
| 1950 |
} |
1950 |
} |
| 1951 |
|
1951 |
|
|
|
1952 |
=head3 message_transport_type_for |
| 1953 |
|
| 1954 |
Given a message transport type, will return the transport type that should be used, |
| 1955 |
including a fallback if needed. |
| 1956 |
|
| 1957 |
my $mtt = $patron->message_transport_type_for('email'); |
| 1958 |
|
| 1959 |
=cut |
| 1960 |
|
| 1961 |
sub message_transport_type_for { |
| 1962 |
my ( $self, $mtt ) = @_; |
| 1963 |
|
| 1964 |
if ( $mtt eq 'email' ) { |
| 1965 |
return 'sms' |
| 1966 |
if C4::Context->preference("FallbackToSMSIfNoEmail") |
| 1967 |
&& $self->smsalertnumber |
| 1968 |
&& !$self->notice_email_address; |
| 1969 |
} |
| 1970 |
|
| 1971 |
return $mtt; |
| 1972 |
} |
| 1973 |
|
| 1952 |
=head3 get_club_enrollments |
1974 |
=head3 get_club_enrollments |
| 1953 |
|
1975 |
|
| 1954 |
=cut |
1976 |
=cut |
|
Lines 3016-3022
sub queue_notice {
Link Here
|
| 3016 |
or ( $mtt eq 'phone' and not $self->phone ) ) |
3038 |
or ( $mtt eq 'phone' and not $self->phone ) ) |
| 3017 |
{ |
3039 |
{ |
| 3018 |
push @{ $return{fallback} }, $mtt; |
3040 |
push @{ $return{fallback} }, $mtt; |
| 3019 |
$mtt = 'print'; |
3041 |
if ( C4::Context->preference("FallbackToSMSIfNoEmail") |
|
|
3042 |
&& $mtt eq 'email' |
| 3043 |
&& $self->smsalertnumber |
| 3044 |
&& !$self->notice_email_address ) |
| 3045 |
{ |
| 3046 |
$mtt = 'sms'; |
| 3047 |
} else { |
| 3048 |
$mtt = 'print'; |
| 3049 |
} |
| 3020 |
} |
3050 |
} |
| 3021 |
next if $mtt eq 'print' && $print_sent; |
3051 |
next if $mtt eq 'print' && $print_sent; |
| 3022 |
$letter_params->{message_transport_type} = $mtt; |
3052 |
$letter_params->{message_transport_type} = $mtt; |