htmlspecialchars(self::getUserFullName($renewResult['user'])), 'membershipTitle' => htmlspecialchars($renewResult['membership']['title']), 'previousExpirationDate' => htmlspecialchars(self::formatDate($renewResult['user']['expiredOn'])), 'newExpirationDate' => htmlspecialchars(self::formatDate($renewResult['newExpirationDate'])), 'userEditUrl' => UserAdminView::getPage('url') . '?action=edit&id=' . $renewResult['user']['id'], ]; $to = App_Settings_Obj::getAdminEmails(); return Qs_Mail::sendTemplate('membershipRenewedToAdmin', $placeholders, $to); } private static function getUserFullName(array $user) { return $user['firstName'] . (empty($user['middleName'] ? '' : ' ' . $user['middleName'])) . ' ' . $user['lastName']; } private static function formatDate($date) { if (empty($date)) { return '-'; } if (false !== ($time = strtotime($date))) { return date('m/d/Y', $time); } return ''; } }