Files
FreshRSS/app/Mailers/UserMailer.php
Alexandre Alapetite 288ed04ccc PHPStan level 6 for all PDO and Exception classes (#5239)
* PHPStan level 6 for all PDO and Exception classes
Contributes to https://github.com/FreshRSS/FreshRSS/issues/4112

* Fix type

* Now also our remaining own librairies

* Motivation for a few more files

* A few more DAO classes

* Last interface
2023-03-31 08:23:39 +02:00

40 lines
944 B
PHP

<?php
/**
* Manage the emails sent to the users.
*/
class FreshRSS_User_Mailer extends Minz_Mailer {
/**
* @var FreshRSS_View
*/
protected $view;
public function send_email_need_validation(string $username, FreshRSS_UserConfiguration $user_config): bool {
Minz_Translate::reset($user_config->language);
$this->view->_path('user_mailer/email_need_validation.txt.php');
$this->view->username = $username;
$this->view->site_title = FreshRSS_Context::$system_conf->title;
$this->view->validation_url = Minz_Url::display(
array(
'c' => 'user',
'a' => 'validateEmail',
'params' => array(
'username' => $username,
'token' => $user_config->email_validation_token
)
),
'txt',
true
);
$subject_prefix = '[' . FreshRSS_Context::$system_conf->title . ']';
return $this->mail(
$user_config->mail_login,
$subject_prefix . ' ' ._t('user.mailer.email_need_validation.title')
);
}
}