Skip to content

Commit

Permalink
Merge pull request #71 from OrifInformatique:Fix_smtp_protocol
Browse files Browse the repository at this point in the history
Fix: repair verification code sent by e-mail
  • Loading branch information
DidierViret committed Jun 14, 2024
2 parents 0acdfde + aa7d710 commit 42882be
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
15 changes: 6 additions & 9 deletions orif/user/Controllers/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -348,18 +348,15 @@ public function generate_send_verification_code($form_email) { // generate code
'SMTPHost' => getenv('SMTP_HOST'),
'SMTPUser' => getenv('SMTP_ID'),
'SMTPPass' => getenv('SMTP_PASSWORD'),
'SMTPPort' => getenv('SMTP_PORT'),
];
'SMTPCrypto' => getenv('SMTP_CRYPTO'),
];

$appTitle = lang('common_lang.app_title');

$email->initialize($emailConfig);

// Sending code to user's orif mail
$email->setFrom('[email protected]', 'ORIF: Vérification du mail'); // 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);
//Sending code to user's orif
$email->setFrom(getenv('SMTP_ID'), lang('common_lang.app_title'));
$email->setSubject(lang('user_lang.mail_verification_code_subject'));
$email->setMessage(lang('user_lang.mail_verification_code_text').$verification_code);
$email->send();

// Set code's expiration timer
Expand Down
2 changes: 2 additions & 0 deletions orif/user/Language/fr/user_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -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: ',
];

0 comments on commit 42882be

Please sign in to comment.