Merge pull request #1737 from andymornes/next

New Block Notification additions
This commit is contained in:
Sebastian Grewe 2014-02-12 07:33:04 +01:00
commit 7e4b5ae038
2 changed files with 6 additions and 1 deletions

View File

@ -152,11 +152,16 @@ if (empty($aAllBlocks)) {
// Notify users
$aAccounts = $notification->getNotificationAccountIdByType('new_block');
if (is_array($aAccounts)) {
$finder = $user->getUserName($aBlock['account_id']);
foreach ($aAccounts as $aData) {
$aMailData['height'] = $aBlock['height'];
$aMailData['subject'] = 'New Block';
$aMailData['email'] = $user->getUserEmail($user->getUserName($aData['account_id']));
$aMailData['shares'] = $iRoundShares;
$aMailData['amount'] = $aBlock['amount'];
$aMailData['difficulty'] = $aBlock['difficulty'];
$aMailData['finder'] = $finder;
if (!$notification->sendNotification($aData['account_id'], 'new_block', $aMailData))
$log->logError('Failed to notify user of new found block: ' . $user->getUserName($aData['account_id']));
}

View File

@ -1,6 +1,6 @@
<html>
<p>{nocache}Block Number {$DATA.height} has been discovered by {$DATA.finder} with a total value of {$DATA.amount}! The current difficulty is {$DATA.difficulty}.{/nocache}</p>
<body>
<p>A new block has been discovered!</p>
<br/>
<br/>
</body>