diff --git a/.gitignore b/.gitignore index 98ac107..707bf70 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ config/database.php uploads/ +vendor/ diff --git a/admin/api/customer-emails.php b/admin/api/customer-emails.php new file mode 100644 index 0000000..f5a773a --- /dev/null +++ b/admin/api/customer-emails.php @@ -0,0 +1,27 @@ + []]); + exit; +} + +$emails = db()->fetchAll( + "SELECT id, subject, status, opened, open_count, opened_at, tags, + DATE_FORMAT(sent_at, '%b %e, %Y %l:%i %p') as sent_at, + message_id, error_message + FROM email_log + WHERE customer_id = :cid + ORDER BY sent_at DESC + LIMIT 50", + ['cid' => $customerId] +); + +echo json_encode(['emails' => $emails ?: []]); diff --git a/admin/customers.php b/admin/customers.php index 22662dc..3a63900 100644 --- a/admin/customers.php +++ b/admin/customers.php @@ -290,6 +290,11 @@ $totalWalletBalance = (float)(db()->fetch("SELECT COALESCE(SUM(wallet_balance),0 Orders +