Skip to content

Commit

Permalink
Fix and rework e-mail send
Browse files Browse the repository at this point in the history
  • Loading branch information
DidierViret committed Jun 14, 2024
1 parent 42882be commit b960636
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
4 changes: 2 additions & 2 deletions orif/common/Language/fr/common_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

return[
// Application name
'app_title' => 'Titre de l\'application <br>(à changer dans common_lang.php)',
'app_title' => 'CI Packbase V4',

// Page titles
'page_prefix' => 'Packbase V4 <br>(à changer dans common_lang.php)',
'page_prefix' => 'Packbase V4',

// Buttons
'btn_admin' => 'Administration',
Expand Down
15 changes: 13 additions & 2 deletions orif/user/Controllers/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -348,17 +348,28 @@ 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

//Sending code to user's mail
$email->setFrom(getenv('SMTP_ID'), lang('common_lang.app_title'));
$email->setTo($form_email);
$email->setSubject(lang('user_lang.mail_verification_code_subject'));
$email->setMessage(lang('user_lang.mail_verification_code_text').$verification_code);

// Comment this line to debug mail sending
$email->send();

// Uncomment this part to debug mail sending
/*
if(!$email->send(false)){
dd($email->printDebugger());
}
*/

// Set code's expiration timer
$_SESSION['timer_start'] = time();
$_SESSION['timer_limit'] = 300; // Written in seconds. 300 = 5 minutes
Expand Down

0 comments on commit b960636

Please sign in to comment.