From: nupplaPhil Date: Sun, 26 Jan 2020 22:47:15 +0000 (+0100) Subject: Some Renames: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ae5ebf1e898f97bf29dc0a73440f8ee89f196f0a;p=friendica-addons.git Some Renames: - EMail => EMail - toEmail => toAddress - fromEmail => fromAddress --- diff --git a/notifyall/NotifyAllEMail.php b/notifyall/NotifyAllEMail.php deleted file mode 100644 index eeca4faf..00000000 --- a/notifyall/NotifyAllEMail.php +++ /dev/null @@ -1,40 +0,0 @@ -get('config', 'sitename'); - - if (empty($config->get('config', 'admin_name'))) { - $sender_name = '"' . $l10n->t('%s Administrator', $sitename) . '"'; - } else { - $sender_name = '"' . $l10n->t('%1$s, %2$s Administrator', $config->get('config', 'admin_name'), $sitename) . '"'; - } - - if (!$config->get('config', 'sender_email')) { - $sender_email = 'noreply@' . $baseUrl->getHostname(); - } else { - $sender_email = $config->get('config', 'sender_email'); - } - - $subject = $_REQUEST['subject']; - - $textversion = strip_tags(html_entity_decode(BBCode::convert(stripslashes(str_replace(["\\r", "\\n"], ["", "\n"], $text))), ENT_QUOTES, 'UTF-8')); - - $htmlversion = BBCode::convert(stripslashes(str_replace(["\\r", "\\n"], ["", "
\n"], $text))); - - parent::__construct($sender_name, $sender_email, $sender_email, '', $subject, $htmlversion, $textversion); - } -} diff --git a/notifyall/NotifyAllEmail.php b/notifyall/NotifyAllEmail.php new file mode 100644 index 00000000..96a57a67 --- /dev/null +++ b/notifyall/NotifyAllEmail.php @@ -0,0 +1,40 @@ +get('config', 'sitename'); + + if (empty($config->get('config', 'admin_name'))) { + $sender_name = '"' . $l10n->t('%s Administrator', $sitename) . '"'; + } else { + $sender_name = '"' . $l10n->t('%1$s, %2$s Administrator', $config->get('config', 'admin_name'), $sitename) . '"'; + } + + if (!$config->get('config', 'sender_email')) { + $sender_email = 'noreply@' . $baseUrl->getHostname(); + } else { + $sender_email = $config->get('config', 'sender_email'); + } + + $subject = $_REQUEST['subject']; + + $textversion = strip_tags(html_entity_decode(BBCode::convert(stripslashes(str_replace(["\\r", "\\n"], ["", "\n"], $text))), ENT_QUOTES, 'UTF-8')); + + $htmlversion = BBCode::convert(stripslashes(str_replace(["\\r", "\\n"], ["", "
\n"], $text))); + + parent::__construct($sender_name, $sender_email, $sender_email, '', $subject, $htmlversion, $textversion); + } +} diff --git a/notifyall/notifyall.php b/notifyall/notifyall.php index c2391fcc..6d179380 100644 --- a/notifyall/notifyall.php +++ b/notifyall/notifyall.php @@ -8,7 +8,7 @@ * Author: Rabuzarus (Port to Friendica) */ -use Friendica\Addon\notifyall\NotifyAllEMail; +use Friendica\Addon\notifyall\NotifyAllEmail; use Friendica\App; use Friendica\Database\DBA; use Friendica\Core\Logger; @@ -60,7 +60,7 @@ function notifyall_post(App $a) return; } - $notifyEmail = new NotifyAllEMail(DI::l10n(), DI::config(), DI::baseUrl(), $text); + $notifyEmail = new NotifyAllEmail(DI::l10n(), DI::config(), DI::baseUrl(), $text); foreach ($recipients as $recipient) { DI::emailer()->send($notifyEmail->withRecipient($recipient['email'])); diff --git a/securemail/SecureTestEMail.php b/securemail/SecureTestEMail.php deleted file mode 100644 index d7f9a296..00000000 --- a/securemail/SecureTestEMail.php +++ /dev/null @@ -1,40 +0,0 @@ -get('config', 'sitename'); - - $hostname = $baseUrl->getHostname(); - if (strpos($hostname, ':')) { - $hostname = substr($hostname, 0, strpos($hostname, ':')); - } - - $sender_email = $config->get('config', 'sender_email'); - if (empty($sender_email)) { - $sender_email = 'noreply@' . $hostname; - } - - $subject = 'Friendica - Secure Mail - Test'; - $message = 'This is a test message from your Friendica Secure Mail addon.'; - - // enable addon for test - $pConfig->set(local_user(), 'securemail', 'enable', 1); - - parent::__construct($sitename, $sender_email, $sender_email, $a->user['email'], - $subject, "

{$message}

", $message, - '', local_user()); - } -} diff --git a/securemail/SecureTestEmail.php b/securemail/SecureTestEmail.php new file mode 100644 index 00000000..37fe5d7c --- /dev/null +++ b/securemail/SecureTestEmail.php @@ -0,0 +1,40 @@ +get('config', 'sitename'); + + $hostname = $baseUrl->getHostname(); + if (strpos($hostname, ':')) { + $hostname = substr($hostname, 0, strpos($hostname, ':')); + } + + $sender_email = $config->get('config', 'sender_email'); + if (empty($sender_email)) { + $sender_email = 'noreply@' . $hostname; + } + + $subject = 'Friendica - Secure Mail - Test'; + $message = 'This is a test message from your Friendica Secure Mail addon.'; + + // enable addon for test + $pConfig->set(local_user(), 'securemail', 'enable', 1); + + parent::__construct($sitename, $sender_email, $sender_email, $a->user['email'], + $subject, "

{$message}

", $message, + '', local_user()); + } +} diff --git a/securemail/securemail.php b/securemail/securemail.php index e25e9669..55d03207 100644 --- a/securemail/securemail.php +++ b/securemail/securemail.php @@ -6,7 +6,7 @@ * Author: Fabio Comuni */ -use Friendica\Addon\securemail\SecureTestEMail; +use Friendica\Addon\securemail\SecureTestEmail; use Friendica\App; use Friendica\Core\Hook; use Friendica\Core\Logger; @@ -89,7 +89,7 @@ function securemail_settings_post(App &$a, array &$b) if ($_POST['securemail-submit'] == DI::l10n()->t('Save and send test')) { - $res = DI::emailer()->send(new SecureTestEMail(DI::app(), DI::config(), DI::pConfig(), DI::baseUrl())); + $res = DI::emailer()->send(new SecureTestEmail(DI::app(), DI::config(), DI::pConfig(), DI::baseUrl())); // revert to saved value DI::pConfig()->set(local_user(), 'securemail', 'enable', $enable);