<?php
/**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
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;
}
}
+ $user = User::getById(local_user());
+
foreach ($recipients as $recipient) {
$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;
}
$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';
$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 = [])
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')