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

(-)a/C4/Auth_with_shibboleth.pm (-3 / +39 lines)
Lines 23-28 use C4::Context; Link Here
23
use Koha::AuthUtils qw( get_script_name );
23
use Koha::AuthUtils qw( get_script_name );
24
use Koha::Database;
24
use Koha::Database;
25
use Koha::Patrons;
25
use Koha::Patrons;
26
use C4::Letters qw( GetPreparedLetter EnqueueLetter );
26
use C4::Members::Messaging;
27
use C4::Members::Messaging;
27
use Carp qw( carp );
28
use Carp qw( carp );
28
use List::MoreUtils qw( any );
29
use List::MoreUtils qw( any );
Lines 134-141 sub _autocreate { Link Here
134
    }
135
    }
135
136
136
    my $patron = Koha::Patron->new( \%borrower )->store;
137
    my $patron = Koha::Patron->new( \%borrower )->store;
137
    C4::Members::Messaging::SetMessagingPreferencesFromDefaults( { borrowernumber => $patron->borrowernumber, categorycode => $patron->categorycode } );
138
    C4::Members::Messaging::SetMessagingPreferencesFromDefaults(
138
139
        {
140
            borrowernumber => $patron->borrowernumber,
141
            categorycode   => $patron->categorycode
142
        }
143
    );
144
145
    # Send welcome email if enabled
146
    if ( $config->{welcome} ) {
147
        my $emailaddr = $patron->notice_email_address;
148
149
        # if we manage to find a valid email address, send notice
150
        if ($emailaddr) {
151
            eval {
152
                my $letter = GetPreparedLetter(
153
                    module      => 'members',
154
                    letter_code => 'WELCOME',
155
                    branchcode  => $patron->branchcode,
156
                    ,
157
                    lang   => $patron->lang || 'default',
158
                    tables => {
159
                        'branches'  => $patron->branchcode,
160
                        'borrowers' => $patron->borrowernumber,
161
                    },
162
                    want_librarian => 1,
163
                ) or return;
164
165
                my $message_id = EnqueueLetter(
166
                    {
167
                        letter                 => $letter,
168
                        borrowernumber         => $patron->id,
169
                        to_address             => $emailaddr,
170
                        message_transport_type => 'email'
171
                    }
172
                );
173
            };
174
        }
175
    }
139
    return ( 1, $patron->cardnumber, $patron->userid );
176
    return ( 1, $patron->cardnumber, $patron->userid );
140
}
177
}
141
178
142
- 

Return to bug 30646