FreshRSS-Extensions/xExtension-ShareByEmail/mailers/Share.php
Alexandre Alapetite cc6bf0d1e6
New developer command to test all third-party extensions
* `composer run-script phpstan-third-party`
* Rename the directory for generate.php to `third-party` instead of `tmp`
* Take advantage of PHPStan checkMissingOverrideMethodAttribute https://phpstan.org/config-reference#checkmissingoverridemethodattribute
* Detected and fixed bug in URL of https://github.com/tunbridgep/freshrss-invidious
2024-04-07 17:06:35 +02:00

28 lines
616 B
PHP

<?php
declare(strict_types=1);
namespace ShareByEmail\mailers;
final class Share extends \Minz_Mailer {
/** @var View */
protected $view;
public function __construct() {
parent::__construct(View::class);
}
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);
}
}