From 6999e7b862dd49b0366bb56d6bf7bcb17c2ea5aa Mon Sep 17 00:00:00 2001 From: Didier Viret Date: Fri, 14 Jun 2024 11:15:37 +0200 Subject: [PATCH] Move e-mail texts in language files --- orif/user/Controllers/Auth.php | 6 +++--- orif/user/Language/fr/user_lang.php | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/orif/user/Controllers/Auth.php b/orif/user/Controllers/Auth.php index a72cd62..664f5a9 100644 --- a/orif/user/Controllers/Auth.php +++ b/orif/user/Controllers/Auth.php @@ -354,10 +354,10 @@ public function generate_send_verification_code($form_email) { // generate code $appTitle = lang('common_lang.app_title'); $email->initialize($emailConfig); //Sending code to user's orif - $email->setFrom('verif@sectioninformatique.ch', 'ORIF: Vérification du mail'); + $email->setFrom(getenv('SMTP_ID'), lang('common_lang.app_title')); // 2nd paramater hard coded since variable not interpreted in SetFrom$email->setTo($form_email); - $email->setSubject('Code de vérification'); - $email->setMessage('Voici votre code de vérification: '.$verification_code); + $email->setSubject(lang('user_lang.mail_verification_code_subject')); + $email->setMessage(lang('user_lang.mail_verification_code_text').$verification_code); $email->send(false); // Set code's expiration timer diff --git a/orif/user/Language/fr/user_lang.php b/orif/user/Language/fr/user_lang.php index e423cbf..4783d8d 100644 --- a/orif/user/Language/fr/user_lang.php +++ b/orif/user/Language/fr/user_lang.php @@ -97,4 +97,6 @@ 'code_expiration_time' => 'Temps restant avant l\'expiration du code:', 'time_expired' => 'Temps expiré', 'resend_msg' => 'Vous n\'avez rien reçu ?', +'mail_verification_code_subject' => 'Code de vérification', +'mail_verification_code_text' => 'Voici votre code de vérification: ', ];