From: dbs Date: Mon, 28 Feb 2011 20:04:48 +0000 (+0000) Subject: Rough draft of email notices supporting French translation based on user stat cat X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=c8db795a4bf682b6936f615bf8b44b3c0b122488;p=contrib%2FConifer.git Rough draft of email notices supporting French translation based on user stat cat git-svn-id: svn://svn.open-ils.org/ILS-Contrib/conifer/branches/rel_1_6_1@1248 6d9bc8c9-1ec2-4278-b937-99fde70a366f --- diff --git a/tools/email_notices_french.sql b/tools/email_notices_french.sql new file mode 100644 index 0000000000..b2886b974b --- /dev/null +++ b/tools/email_notices_french.sql @@ -0,0 +1,162 @@ +-- TODO: RFC 2231: Incorporate Email::MIME::Header as a helper for headers to avoid corrupted subjects / names +-- TODO: RFC 2045: Include MIME headers to mark body as UTF-8 + +-- Start the transaction, but don't commit it automatically +BEGIN; + +-- We need access to the statistical categories for users +-- ID 1 = Overdue +-- ID 105 = Overdue +-- ID 105 = Reminder +-- ID 105 = Password reset +INSERT INTO action_trigger.environment (event_def, path) + VALUES (101, 'usr.stat_cat_entries'), + VALUES (105, 'usr.stat_cat_entries'), + VALUES (106, 'usr.stat_cat_entries'), + VALUES (110, 'usr.stat_cat_entries'); + +-- Update reminder notices with French version +BEGIN; UPDATE action_trigger.event_definition SET template = $$ +[%- USE date -%] +[%- user = target.0.usr -%] +[%- FOR entry IN target.0.usr.stat_cat_entries -%] + [%- IF entry.stat_cat == 2 and entry.stat_cat_entry == 'français' -%] + [%- francais = 'true' -%] + [%- END -%] +[%- END -%] +To: [%- params.recipient_email || user.email %] +From: [%- target.0.target_copy.circ_lib.email || params.sender_email || default_sender %] +[% IF francais -%] +Subject: Rappel (message automatique) + +Madame, (Monsieur,) + +Nos dossiers indiquent que la date de remise de ces articles est demain : + +[% FOR circ IN target -%] + Titre : [% circ.target_copy.call_number.record.simple_record.title %] + Cote : [% circ.target_copy.call_number.label %] + Date d’échéance : [% date.format(helpers.format_date(circ.due_date), '%Y-%m-%d') %] + Code à barres : [% circ.target_copy.barcode %] + Bibliothèque : [% circ.circ_lib.name %] +[% END -%] + +Veuillez renouveler le prêt ou retourner ces articles d’ici demain +afin d’éviter les amendes. +[% ELSE -%] +Subject: Courtesy Notification + +Dear [% user.first_given_name %] [% user.family_name %]: +Our records indicate the following items will be due shortly: + +[% FOR circ IN target -%] + Title: [% circ.target_copy.call_number.record.simple_record.title %] + Barcode: [% circ.target_copy.barcode %] + Due: [% date.format(helpers.format_date(circ.due_date), '%Y-%m-%d') %] + Library: [% circ.circ_lib.name %] +[% END %] +[% END -%] +$$ WHERE id = 106; + +-- Update overdue notices with French version +BEGIN; UPDATE action_trigger.event_definition SET template = $$ +[%- USE date -%] +[%- user = target.0.usr -%] +[%- FOR entry IN target.0.usr.stat_cat_entries -%] + [%- IF entry.stat_cat == 2 and entry.stat_cat_entry == 'français' -%] + [%- francais = 'true' -%] + [%- END -%] +[%- END -%] +To: [%- params.recipient_email || user.email %] +From: [%- target.0.target_copy.circ_lib.email || params.sender_email || default_sender %] +[% IF francais -%] +Subject: Avis de retard (message automatique) + +Madame, (Monsieur,) + +Nos dossiers indiquent que ces articles auraient dû être retournés : + +[% FOR circ IN target -%] + Titre : [% circ.target_copy.call_number.record.simple_record.title %] + Cote : [% circ.target_copy.call_number.label %] + Date d’échéance : [% date.format(helpers.format_date(circ.due_date), '%Y-%m-%d') %] + Code à barres : [% circ.target_copy.barcode %] + Total des amendes : [% circ.billable_transaction.summary.total_owed %] + Bibliothèque : [% circ.circ_lib.name %] [% IF circ.circ_lib.shortname == 'SJCG' %]/ [% circ.target_copy.location.name %] [% END %] +[% END -%] + +Veuillez les retourner dès que possible afin d’éviter des amendes +supplémentaires. +[% ELSE -%] +Subject: Overdue Notification + +Dear [% user.first_given_name %] [% user.family_name %]: + +Our records indicate the following items are overdue. + +[% FOR circ IN target -%] + Title: [% circ.target_copy.call_number.record.simple_record.title %] + Call number : [% circ.target_copy.call_number.label %] + Barcode: [% circ.target_copy.barcode %] + Due: [% date.format(helpers.format_date(circ.due_date), '%Y-%m-%d') %] +[% IF circ.circ_lib.shortname != 'SJCG' -%] + Item Cost: [% helpers.get_copy_price(circ.target_copy) %] + Total Owed For Transaction: [% circ.billable_transaction.summary.total_owed %] +[% END -%] + Library: [% circ.circ_lib.name %] [% IF circ.circ_lib.shortname == 'SJCG' %]/ [% circ.target_copy.location.name %] [% END %] +[% END %] + +[% END %] +$$ WHERE id in (1, 105); + +-- Update password reset notices with French version +BEGIN; UPDATE action_trigger.event_definition SET template = $$ +[%- USE date -%] +[%- user = target.usr -%] +[%- FOR entry IN target.usr.stat_cat_entries -%] + [%- IF entry.stat_cat == 2 and entry.stat_cat_entry == 'français' -%] + [%- francais = 'true' -%] + [%- END -%] +[%- END -%] +To: [%- params.recipient_email || user.email %] +From: [%- params.sender_email || user.home_ou.email || default_sender %] +[% IF francais -%] +Subject: [% user.home_ou.name %] : votre mot de passe du système de la Bibliothèque + +Vous avez reçu ce message parce vous, ou une autre personne, avez demandé de +réinitialiser votre mot de passe du système de la Bibliothèque. Si vous n’avez +pas envoyé cette demande, ne tenez pas compte de ce message et votre mot de +passe actuel continuera de fonctionner. + +Si vous avez demandé la réinitialisation de votre mot de passe du système de la +Bibliothèque, suivez ces étapes pour continuer le processus de réinitialisation : + +1. Cliquez sur le lien suivant https://www.concat.ca/opac/password/[% params.locale || 'fr-CA' %]/[% target.uuid %] +ou copiez-le dans la ligne d’adresse de votre navigateur. + +Le formulaire de réinitialisation de votre mot de passe s’affichera. + +2. Entrez votre nouveau mot de passe dans le formulaire. Vous devez l’entrer +deux fois afin de confirmer qu’il ne comportait pas d’erreurs la première fois. +Si les mots de passe concordent, vous pourrez ensuite ouvrir une session dans +le système de la Bibliothèque avec le nouveau mot de passe. +[% ELSE -%] +Subject: [% user.home_ou.name %]: library account password reset request + +You have received this message because you, or somebody else, requested a reset +of your library system password. If you did not request a reset of your library +system password, just ignore this message and your current password will +continue to work. + +If you did request a reset of your library system password, please perform +the following steps to continue the process of resetting your password: + +1. Open the following link in a web browser: https://www.concat.ca/opac/password/[% params.locale || 'en-US' %]/[% target.uuid %] +The browser displays a password reset form. + +2. Enter your new password in the password reset form in the browser. You must +enter the password twice to ensure that you do not make a mistake. If the +passwords match, you will then be able to log in to your library system account +with the new password. +[% END -%] +$$ WHERE id in (110);