Bug 29046: Add 'EmailFieldPrecedence' preference

This patch adds a new EmailFieldPrecidence systempreference to allow
users to set the precicence in which patron email fields should be used
for communications.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Martin Renvoize 2023-03-10 10:46:51 +00:00 committed by Tomas Cohen Arazi
parent b51ced92db
commit ca4283c585
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F
3 changed files with 23 additions and 0 deletions

View file

@ -0,0 +1,16 @@
use Modern::Perl;
return {
bug_number => "29046",
description => "Allow setting first_valid_email_address field precedence order",
up => sub {
my ($args) = @_;
my ($dbh, $out) = @$args{qw(dbh out)};
$dbh->do(q{
INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
('EmailFieldPrecedence', 'email|emailpro|B_email', NULL, 'Ordered list of patron email fields to use when AutoEmailPrimaryAddress is set to first valid', 'multi')
});
say $out "Added new system preference 'EmailFieldPrecedence'";
},
};

View file

@ -212,6 +212,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
('ElasticsearchCrossFields', '1', '', 'Enable "cross_fields" option for searches using Elastic search.', 'YesNo'),
('EmailAddressForPatronRegistrations', '', '', ' If you choose EmailAddressForPatronRegistrations you have to enter a valid email address: ', 'free'),
('EmailAddressForSuggestions','','',' If you choose EmailAddressForSuggestions you have to enter a valid email address: ','free'),
('EmailFieldPrecedence','email|emailpro|B_email','','Ordered list of patron email fields to use when AutoEmailPrimaryAddress is set to first valid','multiple'),
('EmailFieldPrimary','OFF','email|emailpro|B_email|cardnumber|OFF','Defines the default email address field where patron email notices are sent.','Choice'),
('emailLibrarianWhenHoldIsPlaced','0',NULL,'If ON, emails the librarian whenever a hold is placed','YesNo'),
('EmailOverduesNoEmail','1',NULL,'Send send overdues of patrons without email address to staff','YesNo'),

View file

@ -183,6 +183,12 @@ Patrons:
cardnumber: cardnumber
"OFF": first valid email address
- 'for sending out email notices.'
-
- Use the following patron email fields in order of highest precedence first
- pref: EmailFieldPrecedence
class: multi
- when selecting which email address to use to send patron notices.
- '<br><strong>NOTE:</strong> This preference only takes effect if <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=AutoEmailPrimaryAddress">AutoEmailPrimaryAddress</a> is set to <strong>first valid<strong>'
-
- pref: TalkingTechItivaPhoneNotification
choices: