If this is your first visit, check our documentation. To post, register or login.
Forums / Community Contributed Add-Ons / Contribution-Writing Guidelines / Getting the current email address of the logged in admin

Getting the current email address of the logged in admin

Started by retched on 1 Nov 2012, 2:20 AM · Views: 1,546

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:
949
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
         );