3 namespace Friendica\Addon\notifyall;
5 use Friendica\App\BaseURL;
6 use Friendica\Content\Text\BBCode;
7 use Friendica\Core\Config\IConfig;
8 use Friendica\Core\L10n;
9 use Friendica\Object\Email;
12 * Class for creating a Notify-All EMail
14 class NotifyAllEmail extends Email
16 public function __construct(L10n $l10n, IConfig $config, BaseURL $baseUrl, string $text)
18 $sitename = $config->get('config', 'sitename');
20 if (empty($config->get('config', 'admin_name'))) {
21 $sender_name = '"' . $l10n->t('%s Administrator', $sitename) . '"';
23 $sender_name = '"' . $l10n->t('%1$s, %2$s Administrator', $config->get('config', 'admin_name'), $sitename) . '"';
26 if (!$config->get('config', 'sender_email')) {
27 $sender_email = 'noreply@' . $baseUrl->getHostname();
29 $sender_email = $config->get('config', 'sender_email');
32 $subject = $_REQUEST['subject'];
34 $textversion = strip_tags(html_entity_decode(BBCode::convert(stripslashes(str_replace(["\\r", "\\n"], ["", "\n"], $text))), ENT_QUOTES, 'UTF-8'));
36 $htmlversion = BBCode::convert(stripslashes(str_replace(["\\r", "\\n"], ["", "<br />\n"], $text)));
38 parent::__construct($sender_name, $sender_email, $sender_email, '', $subject, $htmlversion, $textversion);