]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Invite.php
Merge pull request #9509 from MrPetovan/task/5616-clear-notifications-display
[friendica.git] / src / Module / Invite.php
index df569377b9a9bb722470cac3fd954c59b993dcf5..287478954ce65c4c5b52813b29fbdf2368f74cd3 100644 (file)
@@ -1,4 +1,23 @@
 <?php
+/**
+ * @copyright Copyright (C) 2020, Friendica
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
 
 namespace Friendica\Module;
 
@@ -56,7 +75,7 @@ class Invite extends BaseModule
                        $recipient = trim($recipient);
 
                        if (!filter_var($recipient, FILTER_VALIDATE_EMAIL)) {
-                               notice(DI::l10n()->t('%s : Not a valid email address.', $recipient) . EOL);
+                               notice(DI::l10n()->t('%s : Not a valid email address.', $recipient));
                                continue;
                        }
 
@@ -77,7 +96,7 @@ class Invite extends BaseModule
                        }
 
                        $additional_headers = 'From: ' . $app->user['email'] . "\n"
-                               . 'Sender: ' . $app->getSenderEmailAddress() . "\n"
+                               . 'Sender: ' . DI::emailer()->getSiteEmailAddress() . "\n"
                                . 'Content-type: text/plain; charset=UTF-8' . "\n"
                                . 'Content-transfer-encoding: 8bit';
 
@@ -92,15 +111,15 @@ class Invite extends BaseModule
                                $current_invites++;
                                DI::pConfig()->set(local_user(), 'system', 'sent_invites', $current_invites);
                                if ($current_invites > $max_invites) {
-                                       notice(DI::l10n()->t('Invitation limit exceeded. Please contact your site administrator.') . EOL);
+                                       notice(DI::l10n()->t('Invitation limit exceeded. Please contact your site administrator.'));
                                        return;
                                }
                        } else {
-                               notice(DI::l10n()->t('%s : Message delivery failed.', $recipient) . EOL);
+                               notice(DI::l10n()->t('%s : Message delivery failed.', $recipient));
                        }
 
                }
-               notice(DI::l10n()->tt('%d message sent.', '%d messages sent.', $total) . EOL);
+               info(DI::l10n()->tt('%d message sent.', '%d messages sent.', $total));
        }
 
        public static function content(array $parameters = [])