]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Invite.php
Merge pull request #10627 from annando/like-announce
[friendica.git] / src / Module / Invite.php
index 68658f326d976afb49da562cee591dc4b9698149..82b8c604a900939319dd5a718a8ee8c493b4ae0c 100644 (file)
@@ -25,6 +25,7 @@ use Friendica\BaseModule;
 use Friendica\Core\Renderer;
 use Friendica\DI;
 use Friendica\Model;
+use Friendica\Model\User;
 use Friendica\Network\HTTPException;
 use Friendica\Protocol\Email;
 use Friendica\Util\Strings;
@@ -71,6 +72,8 @@ class Invite extends BaseModule
                        }
                }
 
+               $user = User::getById(local_user());
+
                foreach ($recipients as $recipient) {
                        $recipient = trim($recipient);
 
@@ -95,8 +98,7 @@ class Invite extends BaseModule
                                $nmessage = $message;
                        }
 
-                       $additional_headers = 'From: ' . $app->user['email'] . "\n"
-                               . 'Sender: ' . DI::emailer()->getSiteEmailAddress() . "\n"
+                       $additional_headers = 'From: "' . $user['email'] . '" <' . DI::emailer()->getSiteEmailAddress() . ">\n"
                                . 'Content-type: text/plain; charset=UTF-8' . "\n"
                                . 'Content-transfer-encoding: 8bit';
 
@@ -169,7 +171,7 @@ class Invite extends BaseModule
                                DI::l10n()->t('You are cordially invited to join me and other close friends on Friendica - and help us to create a better social web.') . "\r\n" . "\r\n"
                                . $linkTxt
                                . "\r\n" . "\r\n" . (($inviteOnly) ? DI::l10n()->t('You will need to supply this invitation code: $invite_code') . "\r\n" . "\r\n" : '') . DI::l10n()->t('Once you have registered, please connect with me via my profile page at:')
-                               . "\r\n" . "\r\n" . DI::baseUrl()->get() . '/profile/' . $app->user['nickname']
+                               . "\r\n" . "\r\n" . DI::baseUrl()->get() . '/profile/' . $app->getLoggedInUserNickname()
                                . "\r\n" . "\r\n" . DI::l10n()->t('For more information about the Friendica project and why we feel it is important, please visit http://friendi.ca') . "\r\n" . "\r\n",
                        ],
                        '$submit'              => DI::l10n()->t('Submit')