From b2b853d3e0d693289c0f4482d6ebb2b73f259590 Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Sun, 9 Jun 2013 15:24:58 +0200 Subject: [PATCH] Added manual payout notification * Added mail template for manual payouts * Added code to account page to notify via mail on payout * Added new option to notification setting template Adds another feature to #144 --- public/include/pages/account/edit.inc.php | 9 +++++++-- .../mail/notifications/manual_payout.tpl | 8 ++++++++ .../mmcFE/account/notifications/default.tpl | 15 ++++++++++++++- 3 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 public/templates/mail/notifications/manual_payout.tpl diff --git a/public/include/pages/account/edit.inc.php b/public/include/pages/account/edit.inc.php index 1e2941bb..446c13f1 100644 --- a/public/include/pages/account/edit.inc.php +++ b/public/include/pages/account/edit.inc.php @@ -36,12 +36,17 @@ if ( ! $user->checkPin($_SESSION['USERDATA']['id'], $_POST['authPin']) && $_POST } } catch (BitcoinClientException $e) { $_SESSION['POPUP'][] = array('CONTENT' => 'Failed to send LTC, please contact site support immidiately', 'TYPE' => 'errormsg'); - $continue = false; +// $continue = false; } } // Set balance to 0, add to paid out, insert to ledger - if ($continue == true && $transaction->addTransaction($_SESSION['USERDATA']['id'], $dBalance, 'Debit_MP', NULL, $sCoinAddress)) + if ($continue == true && $transaction->addTransaction($_SESSION['USERDATA']['id'], $dBalance, 'Debit_MP', NULL, $sCoinAddress)) { $_SESSION['POPUP'][] = array('CONTENT' => 'Transaction completed', 'TYPE' => 'success'); + $aMailData['email'] = $user->getUserEmail($user->getUserName($_SESSION['USERDATA']['id'])); + $aMailData['amount'] = $dBalance; + $aMailData['subject'] = 'Manual Payout Completed'; + $notification->sendNotification($_SESSION['USERDATA']['id'], 'manual_payout', $aMailData); + } } else { $_SESSION['POPUP'][] = array('CONTENT' => 'Unable to connect to litecoind RPC service', 'TYPE' => 'errormsg'); } diff --git a/public/templates/mail/notifications/manual_payout.tpl b/public/templates/mail/notifications/manual_payout.tpl new file mode 100644 index 00000000..75198d7b --- /dev/null +++ b/public/templates/mail/notifications/manual_payout.tpl @@ -0,0 +1,8 @@ + + +

An manual payout request completed.

+

Amount: {$DATA.amount}

+
+
+ + diff --git a/public/templates/mmcFE/account/notifications/default.tpl b/public/templates/mmcFE/account/notifications/default.tpl index 94c0c2b0..676807d3 100644 --- a/public/templates/mmcFE/account/notifications/default.tpl +++ b/public/templates/mmcFE/account/notifications/default.tpl @@ -29,6 +29,13 @@ + + Manual Payout + + + + + @@ -55,7 +62,13 @@ {$NOTIFICATIONS[notification].id} {$NOTIFICATIONS[notification].time} - {$NOTIFICATIONS[notification].type} + + {if $NOTIFICATIONS[notification].type == new_block}New Block + {else if $NOTIFICATIONS[notification].type == auto_payout}Auto Payout + {else if $NOTIFICATIONS[notification].type == idle_worker}IDLE Worker + {else if $NOTIFICATIONS[notification].type == manual_payout}Manual Payout + {/if} +