Title: Coupon code in admin order email
Last modified: August 22, 2016

---

# Coupon code in admin order email

 *  Resolved [PaulH](https://wordpress.org/support/users/paulhuckstepp/)
 * (@paulhuckstepp)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/coupon-code-in-admin-order-email/)
 * Is it possible to show the coupon code the customer used for the order in the
   email the site admin gets when the order is completed/processed?
 * [https://wordpress.org/plugins/jigoshop/](https://wordpress.org/plugins/jigoshop/)

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

 *  Plugin Author [MWSGD](https://wordpress.org/support/users/mwsgd/)
 * (@mwsgd)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/coupon-code-in-admin-order-email/#post-5754279)
 * Unfortunately, it is not possible without customization. I can recommend this
   to development but if it is urgent, please contact us directly via email: [support@jigoshop.com](https://wordpress.org/support/topic/coupon-code-in-admin-order-email/support@jigoshop.com?output_format=md)
 *  Thread Starter [PaulH](https://wordpress.org/support/users/paulhuckstepp/)
 * (@paulhuckstepp)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/coupon-code-in-admin-order-email/#post-5754295)
 * I think i’ve found a quick way of adding it in myself:
 *     ```
       add_action( 'jigoshop_after_email_order_info', 'add_coupon_code_email', 10000, 1 );
       function add_coupon_code_email( $orderId ) {
       	$orderData = get_post_meta( $orderId, 'order_data', true );
       	$discounts = @$orderData->order_discount_coupons;
       	$codes = "";
       	foreach($discounts  as $discount){
       		$codes .= @$discount->code . ", ";
       	}
       	echo "Discount Code Used: $codes". PHP_EOL. PHP_EOL;
       }
       ```
   
 * The @ are to prevent errors showing up for the moment as the site is live. Not
   ideal I know but the client wants the information in the order email as they 
   don’t want to log into the admin to check on the order!
 *  [megawebmaster](https://wordpress.org/support/users/megawebmaster/)
 * (@megawebmaster)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/coupon-code-in-admin-order-email/#post-5754401)
 * [@paulhuckstepp](https://wordpress.org/support/users/paulhuckstepp/)
 * Yes, this will work as well, but I would propose you do proper checks instead
   of using silence operator 😉
 * Marking as resolved.
 *  Thread Starter [PaulH](https://wordpress.org/support/users/paulhuckstepp/)
 * (@paulhuckstepp)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/coupon-code-in-admin-order-email/#post-5754407)
 * So, is my code correct? It doesn’t look like it is working and as this is a live
   site I can’t debug it as well as I’d like.
 * The main thing I want to check is that the parameter $orderId will be passed 
   through using the hook as I think it is.
 * Thanks.

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

The topic ‘Coupon code in admin order email’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/jigoshop_655549.svg)
 * [Jigoshop](https://wordpress.org/plugins/jigoshop/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/jigoshop/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/jigoshop/)
 * [Active Topics](https://wordpress.org/support/plugin/jigoshop/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/jigoshop/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/jigoshop/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [PaulH](https://wordpress.org/support/users/paulhuckstepp/)
 * Last activity: [11 years, 4 months ago](https://wordpress.org/support/topic/coupon-code-in-admin-order-email/#post-5754407)
 * Status: resolved