Zen Cart Logo
Forums / Contribution-Writing Guidelines / Getting the current email address of the logged in admin

Getting the current email address of the logged in admin

Views: 1,539

Results 1 to 1 of 1
1 Nov 2012, 2:20 AM
#1
retched avatar

retched

Totally Zenned

Join Date:
Jun 2007
Location:
Bronx, New York, United States
Posts:
947
Plugin Contributions:
3

Getting the current email address of the logged in admin

I have the following code present in my script. It's using the ZenCart built in DB Query handler. It's supposed to be pulling up the admin email address of the current admin.

Is there a better way to pull up the email?

  $query = "select admin_email from ". TABLE_ADMIN ." where admin_id = " . $_SESSION['admin_id'];
  $admin = $db->Execute( $query );
  if( $admin ) {    $admin = $admin->fields;  }

      zen_mail($customer['customers_firstname'] . " " . $customer['customers_lastname'],
           $customer['customers_email_address'],
           $subject,
           $text,
           TITLE,
           $admin['admin_email'],
           $block,
           $module_used
         );