View | Details | Raw Unified | Return to bug 21781
Collapse All | Expand All

(-)a/C4/Acquisition.pm (-1 / +4 lines)
Lines 3180-3191 sub NotifyOrderUsers { Link Here
3180
            },
3180
            },
3181
        );
3181
        );
3182
        if ( $letter ) {
3182
        if ( $letter ) {
3183
3184
            my $transport = (C4::Context->preference("FallbackToSMSIfNoEmail")) && ($patron->smsalertnumber) && (!$patron->email) ? 'sms' : 'email';
3185
3183
            C4::Letters::EnqueueLetter(
3186
            C4::Letters::EnqueueLetter(
3184
                {
3187
                {
3185
                    letter         => $letter,
3188
                    letter         => $letter,
3186
                    borrowernumber => $borrowernumber,
3189
                    borrowernumber => $borrowernumber,
3187
                    LibraryName    => C4::Context->preference("LibraryName"),
3190
                    LibraryName    => C4::Context->preference("LibraryName"),
3188
                    message_transport_type => 'email',
3191
                    message_transport_type => $transport,
3189
                }
3192
                }
3190
            ) or warn "can't enqueue letter $letter";
3193
            ) or warn "can't enqueue letter $letter";
3191
        }
3194
        }
(-)a/circ/pendingreserves.pl (-1 / +3 lines)
Lines 85-94 if ( $op eq 'cancel_reserve' and $reserve_id ) { Link Here
85
            if ( $letter ) {
85
            if ( $letter ) {
86
                my $admin_email_address = $library->branchemail || C4::Context->preference('KohaAdminEmailAddress');
86
                my $admin_email_address = $library->branchemail || C4::Context->preference('KohaAdminEmailAddress');
87
87
88
                my $transport = (C4::Context->preference("FallbackToSMSIfNoEmail")) && ($patron->smsalertnumber) && (!$patron->email) ? 'sms' : 'email';
89
88
                C4::Letters::EnqueueLetter(
90
                C4::Letters::EnqueueLetter(
89
                    {   letter                 => $letter,
91
                    {   letter                 => $letter,
90
                        borrowernumber         => $patron->borrowernumber,
92
                        borrowernumber         => $patron->borrowernumber,
91
                        message_transport_type => 'email',
93
                        message_transport_type => $transport,
92
                        from_address           => $admin_email_address,
94
                        from_address           => $admin_email_address,
93
                    }
95
                    }
94
                );
96
                );
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref (-1 / +1 lines)
Lines 29-35 Patrons: Link Here
29
           choices:
29
           choices:
30
               yes: Enable
30
               yes: Enable
31
               no: Disable
31
               no: Disable
32
         - Send purchase suggestion messages by SMS if no patron email is defined.
32
         - Send notices by SMS if no patron email is defined.
33
     -
33
     -
34
         - pref: UseEmailReceipts
34
         - pref: UseEmailReceipts
35
           choices:
35
           choices:
(-)a/misc/cronjobs/automatic_renewals.pl (-1 / +3 lines)
Lines 140-149 if ( $send_notices ) { Link Here
140
            my $library = Koha::Libraries->find( $patron->branchcode );
140
            my $library = Koha::Libraries->find( $patron->branchcode );
141
            my $admin_email_address = $library->branchemail || C4::Context->preference('KohaAdminEmailAddress');
141
            my $admin_email_address = $library->branchemail || C4::Context->preference('KohaAdminEmailAddress');
142
142
143
            my $transport = (C4::Context->preference("FallbackToSMSIfNoEmail")) && ($patron->smsalertnumber) && (!$patron->email) ? 'sms' : 'email';
144
143
            C4::Letters::EnqueueLetter(
145
            C4::Letters::EnqueueLetter(
144
                {   letter                 => $letter,
146
                {   letter                 => $letter,
145
                    borrowernumber         => $borrowernumber,
147
                    borrowernumber         => $borrowernumber,
146
                    message_transport_type => 'email',
148
                    message_transport_type => $transport,
147
                    from_address           => $admin_email_address,
149
                    from_address           => $admin_email_address,
148
                }
150
                }
149
            ) if $confirm;
151
            ) if $confirm;
(-)a/misc/cronjobs/membership_expiry.pl (-1 / +4 lines)
Lines 198-208 while ( my $recent = $upcoming_mem_expires->next ) { Link Here
198
    if( $nomail ) {
198
    if( $nomail ) {
199
        print $letter->{'content'}."\n";
199
        print $letter->{'content'}."\n";
200
    } else {
200
    } else {
201
202
        my $transport = (C4::Context->preference("FallbackToSMSIfNoEmail")) && ($recent->smsalertnumber) && (!$recent->email) ? 'sms' : 'email';
203
201
        C4::Letters::EnqueueLetter({
204
        C4::Letters::EnqueueLetter({
202
            letter                 => $letter,
205
            letter                 => $letter,
203
            borrowernumber         =>  $recent->borrowernumber,
206
            borrowernumber         =>  $recent->borrowernumber,
204
            from_address           => $from_address,
207
            from_address           => $from_address,
205
            message_transport_type => 'email',
208
            message_transport_type => $transport,
206
        });
209
        });
207
    }
210
    }
208
}
211
}
(-)a/opac/opac-shareshelf.pl (-3 / +7 lines)
Lines 165-172 sub notify_owner { Link Here
165
    my $patron = Koha::Patrons->find( $param->{owner} );
165
    my $patron = Koha::Patrons->find( $param->{owner} );
166
    return unless $patron;
166
    return unless $patron;
167
167
168
    my $toaddr = $patron->notice_email_address or return;
168
    my $transport = (C4::Context->preference("FallbackToSMSIfNoEmail")) && ($patron->smsalertnumber) && (!$patron->email) ? 'sms' : 'email';
169
169
170
    warn $transport;
171
    my $toaddr = $transport eq 'sms' ? $patron->smsalertnumber : $patron->notice_email_address or return;
172
173
    warn $toaddr;
170
    #prepare letter
174
    #prepare letter
171
    my $letter = C4::Letters::GetPreparedLetter(
175
    my $letter = C4::Letters::GetPreparedLetter(
172
        module      => 'members',
176
        module      => 'members',
Lines 181-187 sub notify_owner { Link Here
181
    C4::Letters::EnqueueLetter(
185
    C4::Letters::EnqueueLetter(
182
        {
186
        {
183
            letter                 => $letter,
187
            letter                 => $letter,
184
            message_transport_type => 'email',
188
            message_transport_type => $transport,
185
            from_address => C4::Context->preference('KohaAdminEmailAddress'),
189
            from_address => C4::Context->preference('KohaAdminEmailAddress'),
186
            to_address   => $toaddr,
190
            to_address   => $toaddr,
187
        }
191
        }
Lines 209-214 sub process_addrlist { Link Here
209
213
210
sub send_invitekey {
214
sub send_invitekey {
211
    my ($param) = @_;
215
    my ($param) = @_;
216
212
    my $fromaddr = C4::Context->preference('KohaAdminEmailAddress');
217
    my $fromaddr = C4::Context->preference('KohaAdminEmailAddress');
213
    my $url =
218
    my $url =
214
        C4::Context->preference('OPACBaseURL')
219
        C4::Context->preference('OPACBaseURL')
215
- 

Return to bug 21781