Files
FreshRSS/app/Mailers/UserMailer.php
Alexandre Alapetite b1d24fbdb7 PHPStan 2.0 (#7131)
* PHPStan 2.0
fix https://github.com/FreshRSS/FreshRSS/issues/6989
https://github.com/phpstan/phpstan/releases/tag/2.0.0
https://github.com/phpstan/phpstan/blob/2.0.x/UPGRADING.md

* More

* More

* Done

* fix i18n CLI

* Restore a PHPStan Next test
For work towards PHPStan Level 10

* 4 more on Level 10

* fix getTagsForEntry

* API at Level 10

* More Level 10

* Finish Minz at Level 10

* Finish CLI at Level 10

* Finish Controllers at Level 10

* More Level 10

* More

* Pass bleedingEdge

* Clean PHPStan options and add TODOs

* Level 10 for main config

* More

* Consitency array vs. list

* Sanitize themes get_infos

* Simplify TagDAO->getTagsForEntries()

* Finish reportAnyTypeWideningInVarTag

* Prepare checkBenevolentUnionTypes and checkImplicitMixed

* Fixes

* Refix

* Another fix

* Casing of __METHOD__ constant
2024-12-27 12:12:49 +01:00

46 lines
1.1 KiB
PHP

<?php
declare(strict_types=1);
/**
* Manage the emails sent to the users.
*/
class FreshRSS_User_Mailer extends Minz_Mailer {
/**
* @var FreshRSS_View
* @phpstan-ignore property.phpDocType
*/
protected $view;
public function __construct() {
parent::__construct(FreshRSS_View::class);
}
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::systemConf()->title;
$this->view->validation_url = Minz_Url::display(
[
'c' => 'user',
'a' => 'validateEmail',
'params' => [
'username' => $username,
'token' => $user_config->email_validation_token,
],
],
'txt',
true
);
$subject_prefix = '[' . FreshRSS_Context::systemConf()->title . ']';
return $this->mail(
$user_config->mail_login,
$subject_prefix . ' ' . _t('user.mailer.email_need_validation.title')
);
}
}