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

(-)a/C4/Acquisition.pm (-1 / +4 lines)
Lines 3050-3061 sub NotifyOrderUsers { Link Here
3050
            },
3050
            },
3051
        );
3051
        );
3052
        if ( $letter ) {
3052
        if ( $letter ) {
3053
3054
            my $transport = (C4::Context->preference("FallbackToSMSIfNoEmail")) && ($patron->smsalertnumber) && (!$patron->email) ? 'sms' : 'email';
3055
3053
            C4::Letters::EnqueueLetter(
3056
            C4::Letters::EnqueueLetter(
3054
                {
3057
                {
3055
                    letter         => $letter,
3058
                    letter         => $letter,
3056
                    borrowernumber => $borrowernumber,
3059
                    borrowernumber => $borrowernumber,
3057
                    LibraryName    => C4::Context->preference("LibraryName"),
3060
                    LibraryName    => C4::Context->preference("LibraryName"),
3058
                    message_transport_type => 'email',
3061
                    message_transport_type => $transport,
3059
                }
3062
                }
3060
            ) or warn "can't enqueue letter $letter";
3063
            ) or warn "can't enqueue letter $letter";
3061
        }
3064
        }
(-)a/circ/pendingreserves.pl (-1 / +3 lines)
Lines 86-95 if ( $op eq 'cancel_reserve' and $reserve_id ) { Link Here
86
            if ( $letter ) {
86
            if ( $letter ) {
87
                my $admin_email_address = $library->branchemail || C4::Context->preference('KohaAdminEmailAddress');
87
                my $admin_email_address = $library->branchemail || C4::Context->preference('KohaAdminEmailAddress');
88
88
89
                my $transport = (C4::Context->preference("FallbackToSMSIfNoEmail")) && ($patron->smsalertnumber) && (!$patron->email) ? 'sms' : 'email';
90
89
                C4::Letters::EnqueueLetter(
91
                C4::Letters::EnqueueLetter(
90
                    {   letter                 => $letter,
92
                    {   letter                 => $letter,
91
                        borrowernumber         => $patron->borrowernumber,
93
                        borrowernumber         => $patron->borrowernumber,
92
                        message_transport_type => 'email',
94
                        message_transport_type => $transport,
93
                        from_address           => $admin_email_address,
95
                        from_address           => $admin_email_address,
94
                    }
96
                    }
95
                );
97
                );
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref (-6 / +6 lines)
Lines 136-141 Patrons: Link Here
136
               no: "Don't send"
136
               no: "Don't send"
137
         - an email to newly created patrons with their account details.
137
         - an email to newly created patrons with their account details.
138
     -
138
     -
139
         - pref: FallbackToSMSIfNoEmail
140
           choices:
141
               yes: Enable
142
               no: Disable
143
         - Send notices by SMS if no patron email is defined.
144
     -
139
         - pref: UseEmailReceipts
145
         - pref: UseEmailReceipts
140
           choices:
146
           choices:
141
               yes: Send
147
               yes: Send
Lines 171-182 Patrons: Link Here
171
         - ". Override from address with"
177
         - ". Override from address with"
172
         - pref: EmailSMSSendDriverFromAddress
178
         - pref: EmailSMSSendDriverFromAddress
173
         - "for emails sent using \"Email\" send driver."
179
         - "for emails sent using \"Email\" send driver."
174
     -
175
         - pref: FallbackToSMSIfNoEmail
176
           choices:
177
               yes: Enable
178
               no: Disable
179
         - sending purchase suggestion messages by SMS if no patron email is defined.
180
    Patron forms:
180
    Patron forms:
181
     -
181
     -
182
         - "The following <a href='http://schema.koha-community.org/__VERSION__/tables/borrowers.html' target='blank'>database columns</a> must be filled in on the patron entry screen:"
182
         - "The following <a href='http://schema.koha-community.org/__VERSION__/tables/borrowers.html' target='blank'>database columns</a> must be filled in on the patron entry screen:"
(-)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