Bugzilla – Attachment 45479 Details for
Bug 12802
Send notices using several email addresses
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12802: Fix if AutoEmailOpacUser is enabled
Bug-12802-Fix-if-AutoEmailOpacUser-is-enabled.patch (text/plain), 2.37 KB, created by
Alex Arnaud
on 2015-12-08 09:42:01 UTC
(
hide
)
Description:
Bug 12802: Fix if AutoEmailOpacUser is enabled
Filename:
MIME Type:
Creator:
Alex Arnaud
Created:
2015-12-08 09:42:01 UTC
Size:
2.37 KB
patch
obsolete
>From be31c4c83cc4ae4eaefd9ba76e7592a0ef724656 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Mon, 24 Nov 2014 16:14:58 +0100 >Subject: [PATCH] Bug 12802: Fix if AutoEmailOpacUser is enabled > >Test plan: >Verify that the behavior of AutoEmailOpacUser still works as before. >Note that now the email can receive several emails if >AutoEmailPrimaryAddress has several values. > >Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> >--- > members/memberentry.pl | 20 ++++++++------------ > 1 file changed, 8 insertions(+), 12 deletions(-) > >diff --git a/members/memberentry.pl b/members/memberentry.pl >index ae54383..7f72809 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -380,19 +380,15 @@ if ((!$nok) and $nodouble and ($op eq 'insert' or $op eq 'save')){ > # If 'AutoEmailOpacUser' syspref is on, email user their account details from the 'notice' that matches the user's branchcode. > if ( C4::Context->preference("AutoEmailOpacUser") == 1 && $newdata{'userid'} && $newdata{'password'}) { > #look for defined primary email address, if blank - attempt to use borr.email and borr.emailpro instead >- my $emailaddr; >- if (C4::Context->preference("AutoEmailPrimaryAddress") ne 'OFF' && >- $newdata{C4::Context->preference("AutoEmailPrimaryAddress")} =~ /\w\@\w/ ) { >- $emailaddr = $newdata{C4::Context->preference("AutoEmailPrimaryAddress")} >- } >- elsif ($newdata{email} =~ /\w\@\w/) { >- $emailaddr = $newdata{email} >+ my @email_addresses; >+ for my $field ( split /,/, C4::Context->preference("AutoEmailPrimaryAddress") ) { >+ push @email_addresses, $_ if $newdata{$_} =~ /\w@\w/ > } >- elsif ($newdata{emailpro} =~ /\w\@\w/) { >- $emailaddr = $newdata{emailpro} >- } >- elsif ($newdata{B_email} =~ /\w\@\w/) { >- $emailaddr = $newdata{B_email} >+ my $emailaddr = join ", ", @email_addresses; >+ unless ( $emailaddr ) { >+ for my $field ( qw( email emailpro B_email ) ) { >+ $emailaddr = $newdata{$field} if $newdata{$field} =~ m|\w\@\w|; >+ } > } > # if we manage to find a valid email address, send notice > if ($emailaddr) { >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12802
:
31058
|
31059
|
31132
|
31382
|
31383
|
31384
|
31833
|
33864
|
33865
|
33866
|
33867
|
35890
|
35891
|
35892
|
35893
|
35926
|
35927
|
35928
|
35929
|
35930
|
36055
|
36056
|
36057
|
36058
|
36059
|
39762
|
39770
|
40167
|
45476
|
45477
|
45478
|
45479
|
45480
|
45481
|
45482
|
57296
|
61878
|
61879
|
61880
|
61881
|
61882
|
61883
|
61884
|
66934
|
66935
|
66936
|
66937
|
66938
|
66939
|
66940
|
68002
|
68003
|
68004
|
68005
|
68006
|
68007
|
68008
|
68009
|
68010
|
68011
|
68012
|
68013
|
68375
|
68376
|
68377
|
68378
|
68379
|
68380
|
119016
|
149232
|
153540
|
154076
|
159780
|
159857
|
160051
|
160052
|
160090
|
160091
|
160092
|
160103
|
160104
|
160105
|
160106
|
165494
|
165495
|
165496
|
165497