Adding notification on automatic payout

* Added new mail template
* Added notification code to auto_payout cron
This commit is contained in:
Sebastian Grewe 2013-06-09 15:17:14 +02:00
parent 79d9c9714d
commit d723f4e8ef
2 changed files with 20 additions and 3 deletions

View File

@ -52,19 +52,28 @@ if (! empty($users)) {
}
// Send balance, fees are reduced later
try {
/* try {
$bitcoin->sendtoaddress($aUserData['coin_address'], $dBalance);
} catch (BitcoinClientException $e) {
verbose("SEND FAILED\n");
continue;
}
*/
// Create transaction record
if ($transaction->addTransaction($aUserData['id'], $dBalance, 'Debit_AP', NULL, $aUserData['coin_address'], 0.1)) {
verbose("OK\n");
// Notify user via mail
$aMailData['email'] = $user->getUserEmail($user->getUserName($aUserData['id']));
$aMailData['subject'] = 'Auto Payout Completed';
$aMailData['amount'] = $dBalance;
if (!$notification->sendNotification($aUserData['id'], 'auto_payout', $aMailData)) {
verbose("NOTIFY FAILED\n");
} else {
verbose("OK\n");
}
} else {
verbose("FAILED\n");
}
} else {
verbose("SKIPPED\n");
}

View File

@ -0,0 +1,8 @@
<html>
<body>
<p>An automated payout completed.</p>
<p>Amount: {$DATA.amount}</p>
<br/>
<br/>
</body>
</html>