FreshRSS-Extensions/xExtension-ShareByEmail/mailers/Share.php
Alexandre Alapetite 15d66caafb
PHPStan 2.0 (#269)
* Rename to phpstan.dist.neon

* PHPStan 2.0
And update to PHP 8.1+

* Update CI

* Minor analyseAndScan
2025-01-12 11:05:16 +01:00

34 lines
712 B
PHP

<?php
declare(strict_types=1);
namespace ShareByEmail\mailers;
final class Share extends \Minz_Mailer {
/**
* @var View
* @phpstan-ignore property.phpDocType
*/
protected $view;
public function __construct() {
parent::__construct(View::class);
}
/**
* @throws \FreshRSS_Context_Exception
*/
public function send_article(string $to, string $subject, string $content): bool {
$this->view->_path('share_mailer/article.txt.php');
$this->view->content = $content;
if (\FreshRSS_Context::hasSystemConf()) {
$subject_prefix = '[' . \FreshRSS_Context::systemConf()->title . ']';
} else {
$subject_prefix = '';
}
return $this->mail($to, $subject_prefix . ' ' . $subject);
}
}