Title: admin email
Last modified: August 21, 2016

---

# admin email

 *  Resolved [carlyblack](https://wordpress.org/support/users/carlyblack/)
 * (@carlyblack)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/admin-email-5/)
 * Hi Jacob, thanks for a cool plugin!
 * I would just like to know if there is a way to just have the email that goes 
   to the customer (that style) go to admin as well. I’d like to receive the exact
   same email with the exact same styling come to me, it would make it way easier
   to read from my end.
 * if this is possible I’d love to know how, thanks.
 * Carly
 * [http://wordpress.org/plugins/wp-e-commerce-style-email/](http://wordpress.org/plugins/wp-e-commerce-style-email/)

Viewing 12 replies - 1 through 12 (of 12 total)

 *  Plugin Author [Jacob Schwartz](https://wordpress.org/support/users/mightyturtle/)
 * (@mightyturtle)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/admin-email-5/#post-4156916)
 * Hi Carly,
 * I’m glad you’re enjoying my plugin!
 * There are a few ways you could do what you’re after. The most direct ways would
   require some PHP coding and I’m not sure what your skill level is. My plugin 
   does not yet provide this functionality out of the box (though I’ve built similar
   functionality privately, specifically for clients). Do you have any experience
   in PHP with WordPress?
 * There may be an easy way to achieve this, however. Have a look for a plugin that
   simply CC’s emails to your admin address based on subject line matches. If there’s
   something like that out there (I haven’t searched), that could be your easiest
   route.
 * Cheers,
 * Jacob
 *  Thread Starter [carlyblack](https://wordpress.org/support/users/carlyblack/)
 * (@carlyblack)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/admin-email-5/#post-4156923)
 * Hi Jacob,
 * thanks so much for your reply. I had a quick look for that kind of plugin but
   didn’t really find anything.
 * I have some php knowledge, but definitely not an expert. If you could point me
   in the right direction I’d be super appreciative!
 * Regards,
    Carly
 *  Plugin Author [Jacob Schwartz](https://wordpress.org/support/users/mightyturtle/)
 * (@mightyturtle)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/admin-email-5/#post-4156941)
 * Hi Carly,
 * Probably the most direct way to do this would be to hook into the wp_mail filter
   from your theme’s functions file. You would then inspect the $subject variable
   to target specific customer emails and add your admin email address as a BCC 
   recipient in the $headers variable.
 * Purchase receipts have the following $subject value:
    __( ‘Purchase Receipt’,‘
   wpsc’ ) And each other kind of WPEC email has another specific subject you can
   target (order pending, etc).
 * Here’s the reference for the wp_mail function, to give some context:
    [http://codex.wordpress.org/Function_Reference/wp_mail](http://codex.wordpress.org/Function_Reference/wp_mail)
 * You could also have a look at the PHPdoc & definition of wp_mail to see the filter
   being called:
    [http://core.trac.wordpress.org/browser/tags/3.6.1/wp-includes/pluggable.php](http://core.trac.wordpress.org/browser/tags/3.6.1/wp-includes/pluggable.php)
   Line 216.
 * Does this make sense?
 * Jacob
 *  Thread Starter [carlyblack](https://wordpress.org/support/users/carlyblack/)
 * (@carlyblack)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/admin-email-5/#post-4156979)
 * thanks Jacob,
 * I was able to get one of my lovely developers to add some code into functions.
   php and he got it working wonderfully. thanks for pointing me in the right direction.
 * Carly
 *  [Everlast00](https://wordpress.org/support/users/everlast00/)
 * (@everlast00)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/admin-email-5/#post-4156980)
 * Hi, Carlyblack, could you give me some instructions in how exactly your developer
   managed to make this? I’d like to have the same possibility ^^
 *  Thread Starter [carlyblack](https://wordpress.org/support/users/carlyblack/)
 * (@carlyblack)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/admin-email-5/#post-4156981)
 * Hi Everlast00
 * here is the code that he put into my functions.php file. Please note that I still
   get the standard transaction report, but I also get a styled copy the same as
   the customer gets, which is the one that i’ll use for my records, it also makes
   it easier for me to read 🙂
 *     ```
       /**
        * Filter to modify wp_mail header
        */
       add_filter('wp_mail','modify_wpec_mail',12,1);
   
       /**
        * Modify wp_mail header
        */
       function modify_wpec_mail( $vars ) {
   
       	extract($vars);
   
       	if( isset( $subject ) && $subject ) {
       		switch( $subject ) {
       			case __( 'Purchase Report', 'wpsc' ):
       			case __( 'Transaction Report', 'wpsc' ):
       			case __( 'Purchase Receipt', 'wpsc' ):
       			case __( 'Order Pending', 'wpsc' ):
       			case __( 'Order Pending: Payment Required', 'wpsc' ):
       			case get_option( 'wpsc_trackingid_subject' ):
   
       			$headers = modify_wpec_mail_header( $vars );
       		}
       	}
   
       	return compact( 'to', 'subject', 'message', 'headers', 'attachments' );
       }
   
       /**
        * Adds store admin email as BCC
        */
       function modify_wpec_mail_header( $vars ) {
   
       	extract( $vars );
   
       	$headers = $headers."\r\nBcc:".get_option( 'purch_log_email' )."\r\n";
   
       	return $headers;
       }
       /*end*/
       ```
   
 *  Plugin Author [Jacob Schwartz](https://wordpress.org/support/users/mightyturtle/)
 * (@mightyturtle)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/admin-email-5/#post-4156982)
 * Good work!
 *  [Everlast00](https://wordpress.org/support/users/everlast00/)
 * (@everlast00)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/admin-email-5/#post-4156983)
 * Thanks Carlyblack!
 *  [lodie](https://wordpress.org/support/users/lodie/)
 * (@lodie)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/admin-email-5/#post-4157008)
 * I’m a bit confused should I add this code to wp main _functions.php_, theme _functions.
   php_ or plugins _admin\_functions.php_?
 * This seems to be the best way to send order with SKU code to the admin account(
   Transaction Report)? Or are there better ways to adjust the content of the Transaction
   Report and add SKU codes?
 * As I understand it now WP e-Commerce Style Email you can style and adjust the**
   content **of Purchase receipt, Order pending & Order pending payment required
   mail. But only the style of the other mails (like Transaction Report) but not
   the content. Correct?
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/admin-email-5/#post-4157009)
 * **[@lodie](https://wordpress.org/support/users/lodie/)**: If you require assistance
   then, as per the [Forum Welcome](http://codex.wordpress.org/Forum_Welcome#Where_To_Post),
   please post your own topic. This topic references a older version of WordPress.
 *  [lodie](https://wordpress.org/support/users/lodie/)
 * (@lodie)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/admin-email-5/#post-4157010)
 * [@esmi](https://wordpress.org/support/users/esmi/) question is clearly about 
   the code shared in this topic…
 * I’m a bit confused should I add the code from carlyblack to wp main functions.
   php, my theme functions.php or plugins admin_functions.php?
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/admin-email-5/#post-4157011)
 * Please post your own topic.

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘admin email’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-e-commerce-style-email_f39d82.
   svg)
 * [WP e-Commerce Style Email](https://wordpress.org/plugins/wp-e-commerce-style-email/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-e-commerce-style-email/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-e-commerce-style-email/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-e-commerce-style-email/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-e-commerce-style-email/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-e-commerce-style-email/reviews/)

 * 12 replies
 * 5 participants
 * Last reply from: [esmi](https://wordpress.org/support/users/esmi/)
 * Last activity: [12 years, 6 months ago](https://wordpress.org/support/topic/admin-email-5/#post-4157011)
 * Status: resolved