From 81aaee990e2f2f684ae48d19e6ed03036c47eeba Mon Sep 17 00:00:00 2001 From: Aly Badr Date: Tue, 18 Jun 2019 11:01:06 +0200 Subject: [PATCH] notification templates: create notification templates * Adds notification templates by type, language and communication channel. Co-Authored-by: Peter Weber Co-Authored-by: Aly Badr --- data/users.json | 20 +++++----- rero_ils/config.py | 1 - rero_ils/modules/notifications/api.py | 38 ++++++++++++++++++- rero_ils/modules/notifications/dispatcher.py | 28 +++++++++++--- .../templates/email/availability/eng.txt | 17 +++++++++ .../templates/email/availability/fre.txt | 17 +++++++++ .../templates/email/availability/ger.txt | 17 +++++++++ .../templates/email/availability/ita.txt | 17 +++++++++ .../templates/email/availability_eng.txt | 6 --- .../templates/email/due_soon/eng.txt | 16 ++++++++ .../templates/email/due_soon/fre.txt | 16 ++++++++ .../templates/email/due_soon/ger.txt | 16 ++++++++ .../templates/email/due_soon/ita.txt | 16 ++++++++ .../templates/email/due_soon_eng.txt | 6 --- .../templates/email/overdue/eng.txt | 16 ++++++++ .../templates/email/overdue/fre.txt | 16 ++++++++ .../templates/email/overdue/ger.txt | 16 ++++++++ .../templates/email/overdue/ita.txt | 16 ++++++++ .../templates/email/overdue_eng.txt | 6 --- .../templates/email/recall/eng.txt | 16 ++++++++ .../templates/email/recall/fre.txt | 16 ++++++++ .../templates/email/recall/ger.txt | 16 ++++++++ .../templates/email/recall/ita.txt | 16 ++++++++ .../templates/email/recall_eng.txt | 6 --- .../form_patrons/patron-v0.0.1.json | 8 ++-- .../jsonschemas/patrons/patron-v0.0.1.json | 8 ++-- tests/data/data.json | 6 +++ 27 files changed, 342 insertions(+), 51 deletions(-) create mode 100644 rero_ils/modules/notifications/templates/email/availability/eng.txt create mode 100644 rero_ils/modules/notifications/templates/email/availability/fre.txt create mode 100644 rero_ils/modules/notifications/templates/email/availability/ger.txt create mode 100644 rero_ils/modules/notifications/templates/email/availability/ita.txt delete mode 100644 rero_ils/modules/notifications/templates/email/availability_eng.txt create mode 100644 rero_ils/modules/notifications/templates/email/due_soon/eng.txt create mode 100644 rero_ils/modules/notifications/templates/email/due_soon/fre.txt create mode 100644 rero_ils/modules/notifications/templates/email/due_soon/ger.txt create mode 100644 rero_ils/modules/notifications/templates/email/due_soon/ita.txt delete mode 100644 rero_ils/modules/notifications/templates/email/due_soon_eng.txt create mode 100644 rero_ils/modules/notifications/templates/email/overdue/eng.txt create mode 100644 rero_ils/modules/notifications/templates/email/overdue/fre.txt create mode 100644 rero_ils/modules/notifications/templates/email/overdue/ger.txt create mode 100644 rero_ils/modules/notifications/templates/email/overdue/ita.txt delete mode 100644 rero_ils/modules/notifications/templates/email/overdue_eng.txt create mode 100644 rero_ils/modules/notifications/templates/email/recall/eng.txt create mode 100644 rero_ils/modules/notifications/templates/email/recall/fre.txt create mode 100644 rero_ils/modules/notifications/templates/email/recall/ger.txt create mode 100644 rero_ils/modules/notifications/templates/email/recall/ita.txt delete mode 100644 rero_ils/modules/notifications/templates/email/recall_eng.txt diff --git a/data/users.json b/data/users.json index 5b1a6f2ee7..298b7c89d0 100644 --- a/data/users.json +++ b/data/users.json @@ -73,7 +73,7 @@ "postal_code": "11100", "street": "Via Croix Noire 3", "communication_channel": "email", - "communication_language": "it" + "communication_language": "ita" }, { "$schema": "https://ils.rero.ch/schema/patrons/patron-v0.0.1.json", @@ -93,7 +93,7 @@ "postal_code": "11100", "street": "Panoramica Collinare, 47", "communication_channel": "email", - "communication_language": "it" + "communication_language": "ita" }, { "$schema": "https://ils.rero.ch/schema/patrons/patron-v0.0.1.json", @@ -131,7 +131,7 @@ "postal_code": "1950", "street": "Rue du Nord 7", "communication_channel": "email", - "communication_language": "fr" + "communication_language": "fre" }, { "$schema": "https://ils.rero.ch/schema/patrons/patron-v0.0.1.json", @@ -152,7 +152,7 @@ "postal_code": "95054", "street": "520 Scott Blvd", "communication_channel": "email", - "communication_language": "en" + "communication_language": "eng" }, { "$schema": "https://ils.rero.ch/schema/patrons/patron-v0.0.1.json", @@ -173,7 +173,7 @@ "postal_code": "1892", "street": "Route du Village 6", "communication_channel": "email", - "communication_language": "fr" + "communication_language": "fre" }, { "$schema": "https://ils.rero.ch/schema/patrons/patron-v0.0.1.json", @@ -194,7 +194,7 @@ "postal_code": "6500", "street": "Piazza Collegiata 12", "communication_channel": "email", - "communication_language": "it" + "communication_language": "ita" }, { "$schema": "https://ils.rero.ch/schema/patrons/patron-v0.0.1.json", @@ -215,7 +215,7 @@ "postal_code": "1920", "street": "Gare 45", "communication_channel": "email", - "communication_language": "en" + "communication_language": "eng" }, { "$schema": "https://ils.rero.ch/schema/patrons/patron-v0.0.1.json", @@ -236,7 +236,7 @@ "postal_code": "1926", "street": "Vignettes 25", "communication_channel": "email", - "communication_language": "de" + "communication_language": "ger" }, { "$schema": "https://ils.rero.ch/schema/patrons/patron-v0.0.1.json", @@ -275,7 +275,7 @@ "postal_code": "55555", "street": "Magic Street 3", "communication_channel": "email", - "communication_language": "en" + "communication_language": "eng" }, { "$schema": "https://ils.rero.ch/schema/patrons/patron-v0.0.1.json", @@ -295,6 +295,6 @@ "postal_code": "55555", "street": "Diagon Alley 72", "communication_channel": "email", - "communication_language": "en" + "communication_language": "eng" } ] diff --git a/rero_ils/config.py b/rero_ils/config.py index ce8c6a9941..ab183059a6 100644 --- a/rero_ils/config.py +++ b/rero_ils/config.py @@ -910,7 +910,6 @@ def _(x): 'notif': '/notifications/notification-v0.0.1.json', } - # Login Configuration # =================== #: Allow password change by users. diff --git a/rero_ils/modules/notifications/api.py b/rero_ils/modules/notifications/api.py index eee1a23cb9..767b6f044e 100644 --- a/rero_ils/modules/notifications/api.py +++ b/rero_ils/modules/notifications/api.py @@ -27,9 +27,10 @@ from __future__ import absolute_import, print_function from copy import deepcopy -from datetime import datetime +from datetime import datetime, timedelta from functools import partial +import ciso8601 from invenio_search.api import RecordsSearch from .dispatcher import Dispatcher @@ -37,6 +38,7 @@ from ..api import IlsRecord from ..documents.api import Document from ..fetchers import id_fetcher +from ..libraries.api import Library from ..locations.api import Location from ..minters import id_minter from ..patrons.api import Patron @@ -84,6 +86,7 @@ def update_process_date(self): def replace_pids_and_refs(self): """Dumps data.""" + from ..items.api import Item try: self.init_loan() data = deepcopy(self.replace_refs()) @@ -91,6 +94,7 @@ def replace_pids_and_refs(self): data['loan']['item'] = self.item.replace_refs().dumps() # del(data['loan']['item_pid']) data['loan']['patron'] = self.patron.replace_refs().dumps() + # language = data['loan']['patron']['communication_language'] # del(data['loan']['patron_pid']) data['loan']['transaction_user'] = \ self.transaction_user.replace_refs().dumps() @@ -103,7 +107,37 @@ def replace_pids_and_refs(self): data['loan']['pickup_location'] = \ pickup_location.replace_refs().dumps() # del(data['loan']['pickup_location_pid']) - data['loan']['document'] = self.document.replace_refs().dumps() + library_pid = data['loan']['pickup_location']['library']['pid'] + library = Library.get_record_by_pid(library_pid) + data['loan']['pickup_location']['library'] = library + keep_until = datetime.now() + timedelta(days=10) + next_open = library.next_open(keep_until) + # language = data['loan']['patron']['communication_language'] + next_open = next_open.strftime("%d.%m.%Y") + data['loan']['next_open'] = next_open + else: + data['loan']['pickup_location'] = \ + self.transaction_location.replace_refs().dumps() + item_pid = data['loan']['item_pid'] + library = Item.get_record_by_pid(item_pid).get_library() + data['loan']['library'] = library + + document = self.document.replace_refs().dumps() + data['loan']['document'] = document + authors = document.get('authors', '') + if authors: + author = authors[0].get('name', '') + if not author: + mef_list = ['name_fr', 'name_de', 'name_it', 'name_en'] + for a_name in mef_list: + if authors[0].get(a_name, ''): + author = authors[0].get(a_name) + break + data['loan']['author'] = author + end_date = data.get('loan').get('end_date') + if end_date: + end_date = ciso8601.parse_datetime_as_naive(end_date) + data['loan']['end_date'] = end_date.strftime("%d.%m.%Y") # del(data['loan']['document_pid']) return data except Exception as e: diff --git a/rero_ils/modules/notifications/dispatcher.py b/rero_ils/modules/notifications/dispatcher.py index 84c01c743f..6ff0fcf18b 100644 --- a/rero_ils/modules/notifications/dispatcher.py +++ b/rero_ils/modules/notifications/dispatcher.py @@ -26,6 +26,7 @@ from __future__ import absolute_import, print_function +from flask import current_app from flask_security.utils import config_value from invenio_mail.api import TemplatedMessage from invenio_mail.tasks import send_email @@ -38,15 +39,26 @@ def dispatch_notification(self, notification=None): """Dispatch the notification.""" if notification: data = notification.replace_pids_and_refs() - self.send_mail(data=data) + communication_channel = \ + data['loan']['patron']['communication_channel'] + if communication_channel == 'email': + self.send_mail(data=data) + if communication_channel == 'sms': + pass + if communication_channel == 'whatsapp': + pass + if communication_channel == 'letter': + pass notification = notification.update_process_date() return notification def send_mail(self, data): """Send email.""" + data['loan']['profile_url'] = \ + 'https://ils.test.rero.ch/patrons/profile' notification_type = data.get('notification_type') - language = 'eng' - template = 'email/{type}_{lang}'.format( + language = data['loan']['patron']['communication_language'] + template = 'email/{type}/{lang}'.format( type=notification_type, lang=language ) @@ -54,13 +66,17 @@ def send_mail(self, data): msg = TemplatedMessage( # template_html='{template}.html'.format(template=template), template_body='{template}.txt'.format(template=template), - subject=notification_type, sender=config_value('EMAIL_SENDER'), recipients=[recipient], ctx=data['loan'] ) - + text = msg.body.split('\n') + msg.subject = text[0] + msg.body = '\n'.join(text[1:]) try: - send_email.delay(msg.__dict__) + send_email.run(msg.__dict__) + # TODO: investigate why delay does not work + # send_email.delay(msg.__dict__) + # current_app.extensions['mail'].send(msg) except Exception as e: raise(e) diff --git a/rero_ils/modules/notifications/templates/email/availability/eng.txt b/rero_ils/modules/notifications/templates/email/availability/eng.txt new file mode 100644 index 0000000000..f6642ef923 --- /dev/null +++ b/rero_ils/modules/notifications/templates/email/availability/eng.txt @@ -0,0 +1,17 @@ +Invitation to pick up a document +Dear patron, + +The document you requested is now available. You can pick it up at the loan desk of the library mentioned below. + +{% if author %}Author : {{ author }}{% endif %} +Title: {{ document.title }} +Pick up location: {{ pickup_location.library.name }} +To pick up until: {{ next_open }} + +Should the document not be picked up within the given period, it will be made available for other people. +You can consult your account and extend the loan period of your documents at: {{ profile_url }} + +Best regards + +{{ pickup_location.library.name }} +{{ pickup_location.library.address }} diff --git a/rero_ils/modules/notifications/templates/email/availability/fre.txt b/rero_ils/modules/notifications/templates/email/availability/fre.txt new file mode 100644 index 0000000000..eb9c533f96 --- /dev/null +++ b/rero_ils/modules/notifications/templates/email/availability/fre.txt @@ -0,0 +1,17 @@ +Invitation à retirer un document +Chère lectrice, cher lecteur, + +Le document que vous avez demandé est maintenant disponible. Vous pouvez venir le retirer au bureau de prêt de la bibliothèque mentionnée ci-dessous. + +{% if author %}Auteur : {{ author }}{% endif %} +Titre : {{ document.title }} +Lieu de retrait : {{ pickup_location.library.name }} +A retirer jusqu'au : {{ next_open }} + +Si le document n'est pas retiré dans les délais, il sera remis en circulation pour d'autres personnes. +Vous pouvez consulter votre compte et prolonger la durée de prêt de vos documents à l'adresse : {{ profile_url }} + +Avec nos compliments + +{{ pickup_location.library.name }} +{{ pickup_location.library.address }} diff --git a/rero_ils/modules/notifications/templates/email/availability/ger.txt b/rero_ils/modules/notifications/templates/email/availability/ger.txt new file mode 100644 index 0000000000..22459333bd --- /dev/null +++ b/rero_ils/modules/notifications/templates/email/availability/ger.txt @@ -0,0 +1,17 @@ +Abholeinladung +Sehr geehrte Leserin, sehr geehrter Leser, + +Das von Ihnen bestellte Dokument ist nun verfügbar und kann an der Ausleihtheke der nachstehend genannten Bibliothek abgeholt werden. + +{% if author %}Autor : {{ author }}{% endif %} +Titel: {{ document.title }} +Abholort: {{ pickup_location.library.name }} +Abholen bis: {{ next_open }} + +Wenn das Dokument innerhalb der gegebenen Frist nicht abgeholt wird, wird es anderen Personen zur Verfügung gestellt. +Unter folgender Adresse können Sie Ihr Konto einsehen und die Ausleihfrist Ihrer Dokumente verlängern: {{ profile_url }} + +Freundliche Grüsse + +{{ pickup_location.library.name }} +{{ pickup_location.library.address }} diff --git a/rero_ils/modules/notifications/templates/email/availability/ita.txt b/rero_ils/modules/notifications/templates/email/availability/ita.txt new file mode 100644 index 0000000000..e9aed5b959 --- /dev/null +++ b/rero_ils/modules/notifications/templates/email/availability/ita.txt @@ -0,0 +1,17 @@ +Invito a ritirare un documento +Cara lettrice, caro lettore, + +Il documento che Lei ha domandato è ora disponibile. Lei può ritirarlo al servizio prestiti della biblioteca sotto indicata. + +{% if author %}Autore : {{ author }}{% endif %} +Titolo: {{ document.title }} +Punto di ritiro: {{ pickup_location.library.name }} +Ritirare entro: {{ next_open }} + +Se il documento non è ritirato entro detto termine, esso sarà rimesso in circolazione per altre persone. +Lei può consultare il Suo conto et prorogare la durata di prestito dei Suoi documenti al seguente indirizzo: {{ profile_url }} + +Cordiali saluti + +{{ pickup_location.library.name }} +{{ pickup_location.library.address }} diff --git a/rero_ils/modules/notifications/templates/email/availability_eng.txt b/rero_ils/modules/notifications/templates/email/availability_eng.txt deleted file mode 100644 index 39babbd95b..0000000000 --- a/rero_ils/modules/notifications/templates/email/availability_eng.txt +++ /dev/null @@ -1,6 +0,0 @@ -Document is available: -pid: {{ document.pid }} -title: {{ document.title }} - -Best regards -Your library diff --git a/rero_ils/modules/notifications/templates/email/due_soon/eng.txt b/rero_ils/modules/notifications/templates/email/due_soon/eng.txt new file mode 100644 index 0000000000..3ef99b9506 --- /dev/null +++ b/rero_ils/modules/notifications/templates/email/due_soon/eng.txt @@ -0,0 +1,16 @@ +Expiry notice +Dear patron, + +The loan period of following documents is expiring: + +{% if author %}Author : {{ author }}{% endif %} +Title: {{ document.title }} +Due date: {{ end_date }} +Note: Non extendable + +You can consult your account and extend the loan period of your documents at: {{ profile_url }} + +Best regards + +{{ library.name }} +{{ library.address }} diff --git a/rero_ils/modules/notifications/templates/email/due_soon/fre.txt b/rero_ils/modules/notifications/templates/email/due_soon/fre.txt new file mode 100644 index 0000000000..bbade42cbb --- /dev/null +++ b/rero_ils/modules/notifications/templates/email/due_soon/fre.txt @@ -0,0 +1,16 @@ +Avis d'échéance +Chère lectrice, cher lecteur, + +Le délai de prêt des documents mentionnés ci-dessous arrive à échéance : + +{% if author %}Auteur : {{ author }}{% endif %} +Titre : {{ document.title }} +Echéance : {{ end_date }} +Note : Non extendable + +Vous pouvez consulter votre compte et prolonger la durée de prêt de vos documents à l'adresse : {{ profile_url }} + +Avec nos compliments + +{{ library.name }} +{{ library.address }} diff --git a/rero_ils/modules/notifications/templates/email/due_soon/ger.txt b/rero_ils/modules/notifications/templates/email/due_soon/ger.txt new file mode 100644 index 0000000000..d7dec4087b --- /dev/null +++ b/rero_ils/modules/notifications/templates/email/due_soon/ger.txt @@ -0,0 +1,16 @@ +Ablauf der Ausleihfrist +Sehr geehrte Leserin, sehr geehrter Leser, + +Die Ausleihfrist der folgenden Dokumente läuft ab: + +{% if author %}Autor : {{ author }}{% endif %} +Titel: {{ document.title }} +Rückgabedatum: {{ end_date }} +Anmerkung: Non extendable + +Unter folgender Adresse können Sie Ihr Konto einsehen und die Ausleihfrist Ihrer Dokumente verlängern: {{ profile_url }} + +Freundliche Grüsse + +{{ library.name }} +{{ library.address }} diff --git a/rero_ils/modules/notifications/templates/email/due_soon/ita.txt b/rero_ils/modules/notifications/templates/email/due_soon/ita.txt new file mode 100644 index 0000000000..34022a6bf9 --- /dev/null +++ b/rero_ils/modules/notifications/templates/email/due_soon/ita.txt @@ -0,0 +1,16 @@ +Avviso di scadenza +Cara lettrice, caro lettore, + +La durata di prestito dei seguenti documenti sta per scadere: + +{% if author %}Autore : {{ author }}{% endif %} +Titolo: {{ document.title }} +Scadenza: {{ end_date }} +Nota: Non extendable + +Lei può consultare il Suo conto et prorogare la durata di prestito dei Suoi documenti al seguente indirizzo: {{ profile_url }} + +Cordiali saluti + +{{ library.name }} +{{ library.address }} diff --git a/rero_ils/modules/notifications/templates/email/due_soon_eng.txt b/rero_ils/modules/notifications/templates/email/due_soon_eng.txt deleted file mode 100644 index 08674e8494..0000000000 --- a/rero_ils/modules/notifications/templates/email/due_soon_eng.txt +++ /dev/null @@ -1,6 +0,0 @@ -Document due soon: -pid: {{ document.pid }} -title: {{ document.title }} - -Best regards -Your library diff --git a/rero_ils/modules/notifications/templates/email/overdue/eng.txt b/rero_ils/modules/notifications/templates/email/overdue/eng.txt new file mode 100644 index 0000000000..6ee01cc999 --- /dev/null +++ b/rero_ils/modules/notifications/templates/email/overdue/eng.txt @@ -0,0 +1,16 @@ +1st reminder +Dear patron, + +The loan period of following documents has expired: + +{% if author %}Author : {{ author }}{% endif %} +Title: {{ document.title }} +Due date: {{ end_date }} +Note: 1st reminder + +You can consult your account and extend the loan period of your documents at: {{ profile_url }} + +Best regards + +{{ library.name }} +{{ library.address }} diff --git a/rero_ils/modules/notifications/templates/email/overdue/fre.txt b/rero_ils/modules/notifications/templates/email/overdue/fre.txt new file mode 100644 index 0000000000..7e1d419f75 --- /dev/null +++ b/rero_ils/modules/notifications/templates/email/overdue/fre.txt @@ -0,0 +1,16 @@ +1er rappel +Chère lectrice, cher lecteur, + +La durée du prêt des documents mentionnés ci-dessous est échue : + +{% if author %}Auteur : {{ author }}{% endif %} +Titre : {{ document.title }} +Echéance : {{ end_date }} +Note : 1er rappel + +Vous pouvez consulter votre compte et prolonger la durée de prêt de vos documents à l'adresse : {{ profile_url }} + +Avec nos compliments + +{{ library.name }} +{{ library.address }} diff --git a/rero_ils/modules/notifications/templates/email/overdue/ger.txt b/rero_ils/modules/notifications/templates/email/overdue/ger.txt new file mode 100644 index 0000000000..96ac82a28a --- /dev/null +++ b/rero_ils/modules/notifications/templates/email/overdue/ger.txt @@ -0,0 +1,16 @@ +1. Mahnung +Sehr geehrte Leserin, sehr geehrter Leser, + +Die Ausleihfrist folgender Dokumente ist abgelaufen: + +{% if author %}Autor : {{ author }}{% endif %} +Titel: {{ document.title }} +Rückgabedatum: {{ end_date }} +Anmerkung: 1. Mahnung + +Unter folgender Adresse können Sie Ihr Konto einsehen und die Ausleihfrist Ihrer Dokumente verlängern: {{ profile_url }} + +Freundliche Grüsse + +{{ library.name }} +{{ library.address }} diff --git a/rero_ils/modules/notifications/templates/email/overdue/ita.txt b/rero_ils/modules/notifications/templates/email/overdue/ita.txt new file mode 100644 index 0000000000..44b6c8993f --- /dev/null +++ b/rero_ils/modules/notifications/templates/email/overdue/ita.txt @@ -0,0 +1,16 @@ +1° richiamo +Cara lettrice, caro lettore, + +La durata di prestito dei seguenti documenti è scaduta: + +{% if author %}Autore : {{ author }}{% endif %} +Titolo: {{ document.title }} +Scadenza: {{ end_date }} +NoNotate: 1° richiamo + +Lei può consultare il Suo conto et prorogare la durata di prestito dei Suoi documenti al seguente indirizzo: {{ profile_url }} + +Cordiali saluti + +{{ library.name }} +{{ library.address }} diff --git a/rero_ils/modules/notifications/templates/email/overdue_eng.txt b/rero_ils/modules/notifications/templates/email/overdue_eng.txt deleted file mode 100644 index 88c78d0411..0000000000 --- a/rero_ils/modules/notifications/templates/email/overdue_eng.txt +++ /dev/null @@ -1,6 +0,0 @@ -Document overdue: -pid: {{ document.pid }} -title: {{ document.title }} - -Best regards -Your library diff --git a/rero_ils/modules/notifications/templates/email/recall/eng.txt b/rero_ils/modules/notifications/templates/email/recall/eng.txt new file mode 100644 index 0000000000..f99e8ae24e --- /dev/null +++ b/rero_ils/modules/notifications/templates/email/recall/eng.txt @@ -0,0 +1,16 @@ +Non-extendable document +Dear patron, + +The document you borrowed has been requested by another person. An extension of the loan period is therefore no longer possible and we kindly ask you to return it at the latest by the due date. + +{% if author %}Author : {{ author }}{% endif %} +Title: {{ document.title }} +Due date: {{ end_date }} +Note: Non-extendable + +You can consult your account at: {{ profile_url }} + +Best regards + +{{ library.name }} +{{ library.address }} diff --git a/rero_ils/modules/notifications/templates/email/recall/fre.txt b/rero_ils/modules/notifications/templates/email/recall/fre.txt new file mode 100644 index 0000000000..02d96c9a6c --- /dev/null +++ b/rero_ils/modules/notifications/templates/email/recall/fre.txt @@ -0,0 +1,16 @@ +Document non prolongeable +Chère lectrice, cher lecteur, + +Le document que vous avez emprunté vient d'être réservé par une autre personne. D'ores et déjà nous vous signalons que nous ne pourrons pas le prolonger et vous demandons de bien vouloir le restituer au plus tard à la date d'échéance. + +{% if author %}Auteur : {{ author }}{% endif %} +Titre : {{ document.title }} +Échéance : {{ end_date }} +Note : Non prolongeable + +Vous pouvez consulter votre compte à l'adresse : {{ profile_url }} + +Avec nos compliments + +{{ library.name }} +{{ library.address }} diff --git a/rero_ils/modules/notifications/templates/email/recall/ger.txt b/rero_ils/modules/notifications/templates/email/recall/ger.txt new file mode 100644 index 0000000000..e1fb7b4eaa --- /dev/null +++ b/rero_ils/modules/notifications/templates/email/recall/ger.txt @@ -0,0 +1,16 @@ +Nicht verlängerbares Dokument +Sehr geehrte Leserin, sehr geehrter Leser, + +Das von Ihnen ausgeliehene Dokument ist von einer anderen Person reserviert worden. Eine Verlängerung der Ausleihfrist ist deshalb nicht mehr möglich und wir bitten Sie, das Dokument spätestens bis zum Rückgabedatum zurückzugeben. + +{% if author %}Autor : {{ author }}{% endif %} +Titel: {{ document.title }} +Rückgabedatum: {{ end_date }} +Anmerkung: Nicht verlängerbar + +Unter folgender Adresse können Sie Ihr Konto einsehen: {{ profile_url }} + +Freundliche Grüsse + +{{ library.name }} +{{ library.address }} diff --git a/rero_ils/modules/notifications/templates/email/recall/ita.txt b/rero_ils/modules/notifications/templates/email/recall/ita.txt new file mode 100644 index 0000000000..6313bf59b6 --- /dev/null +++ b/rero_ils/modules/notifications/templates/email/recall/ita.txt @@ -0,0 +1,16 @@ +Documento non prorogabile +Cara lettrice, caro lettore, + +Il documento che Lei ha presto in prestito è stato riservato da un'altra persona. Una proroga della durata di prestito non è quindi più possibile e La preghiamo di restituirlo entro la scadenza. + +{% if author %}Autore : {{ author }}{% endif %} +Titolo: {{ document.title }} +Scadenza: {{ end_date }} +Nota: Non prorogabile + +Lei può consultare il Suo conto al seguente indirizzo: {{ profile_url }} + +Cordiali saluti + +{{ library.name }} +{{ library.address }} diff --git a/rero_ils/modules/notifications/templates/email/recall_eng.txt b/rero_ils/modules/notifications/templates/email/recall_eng.txt deleted file mode 100644 index 967ca90e9b..0000000000 --- a/rero_ils/modules/notifications/templates/email/recall_eng.txt +++ /dev/null @@ -1,6 +0,0 @@ -Document recalled: -pid: {{ document.pid }} -title: {{ document.title }} - -Best regards -Your library diff --git a/rero_ils/modules/patrons/jsonschemas/form_patrons/patron-v0.0.1.json b/rero_ils/modules/patrons/jsonschemas/form_patrons/patron-v0.0.1.json index e512fa858f..b1b8a330fd 100644 --- a/rero_ils/modules/patrons/jsonschemas/form_patrons/patron-v0.0.1.json +++ b/rero_ils/modules/patrons/jsonschemas/form_patrons/patron-v0.0.1.json @@ -157,10 +157,10 @@ "htmlClass": "px-2", "type": "select", "titleMap": { - "en": "English", - "fr": "French", - "de": "German", - "it": "Italian" + "eng": "English", + "fre": "French", + "ger": "German", + "ita": "Italian" }, "placeHolder": "Select\u2026", "condition": { diff --git a/rero_ils/modules/patrons/jsonschemas/patrons/patron-v0.0.1.json b/rero_ils/modules/patrons/jsonschemas/patrons/patron-v0.0.1.json index 53d116dd30..4fc18a7aec 100644 --- a/rero_ils/modules/patrons/jsonschemas/patrons/patron-v0.0.1.json +++ b/rero_ils/modules/patrons/jsonschemas/patrons/patron-v0.0.1.json @@ -138,10 +138,10 @@ "title": "Communication language", "type": "string", "enum": [ - "de", - "en", - "fr", - "it" + "ger", + "eng", + "fre", + "ita" ] } } diff --git a/tests/data/data.json b/tests/data/data.json index f9642705b8..8b8431b21a 100644 --- a/tests/data/data.json +++ b/tests/data/data.json @@ -1334,6 +1334,8 @@ }, "email": "lroduit@gmail.com", "phone": "+41324993156", + "communication_language": "eng", + "communication_channel": "email", "roles": [ "patron" ] @@ -1353,6 +1355,8 @@ }, "email": "lmoret@gmail.com", "phone": "+41324993151", + "communication_language": "eng", + "communication_channel": "email", "roles": [ "patron" ] @@ -1407,6 +1411,8 @@ }, "email": "reroilstest+jules@gmail.com", "phone": "+41324993673", + "communication_language": "eng", + "communication_channel": "email", "roles": [ "patron" ]