From 9cf6e7c294608665a5ccf11f6dd5e04824fa429b Mon Sep 17 00:00:00 2001 From: kanoi Date: Mon, 18 Apr 2016 15:33:41 +1000 Subject: [PATCH] php - send emails on multi-payaddress changes --- pool/page_addrmgt.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/pool/page_addrmgt.php b/pool/page_addrmgt.php index b0b1a6de..3159d969 100644 --- a/pool/page_addrmgt.php +++ b/pool/page_addrmgt.php @@ -1,5 +1,7 @@ Address Management'; @@ -141,6 +143,7 @@ function addrmgtuser($data, $user, $err) function doaddrmgt($data, $user) { $err = ''; + $ans = null; $OK = getparam('OK', false); $count = getparam('rows', false); $pass = getparam('pass', false); @@ -163,6 +166,23 @@ function doaddrmgt($data, $user) $ans = userSettings($user, null, $addrarr, $pass, $twofa); if ($ans['STATUS'] != 'ok') $err = $ans['ERROR']; + else + { + if (isset($ans['email'])) + $email = $ans['email']; + else + $email = ''; + + $emailinfo = getOpts($user, emailOptList()); + if ($emailinfo['STATUS'] != 'ok') + { + if ($err != '') + $err .= '
'; + $err .= 'An error occurred, check your details below'; + } + else + payoutAddressChanged($email, zeip(), $emailinfo); + } } }