Adding notification on automatic payout
* Added new mail template * Added notification code to auto_payout cron
This commit is contained in:
parent
79d9c9714d
commit
d723f4e8ef
@ -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");
|
||||
}
|
||||
|
||||
8
public/templates/mail/notifications/auto_payout.tpl
Normal file
8
public/templates/mail/notifications/auto_payout.tpl
Normal file
@ -0,0 +1,8 @@
|
||||
<html>
|
||||
<body>
|
||||
<p>An automated payout completed.</p>
|
||||
<p>Amount: {$DATA.amount}</p>
|
||||
<br/>
|
||||
<br/>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in New Issue
Block a user