Title: Conditional show button based on e-mail does not work
Last modified: August 19, 2023

---

# Conditional show button based on e-mail does not work

 *  Resolved [joeri2023](https://wordpress.org/support/users/joeri2023/)
 * (@joeri2023)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/conditional-show-button-based-on-e-mail-does-not-work/)
 * Hi there, could you please help me with the following: 
   I synchronize orders 
   from a seller platform. I use a different invoice template for these orders. 
   I can differentiate on e-mail address, since the platform user uses the platform
   e-mail address. I created two templates and checked two boxes:
    1. Don’t show this template in the orders page if the order doesn’t met this condition
    2. Field customer e-mail not contains x.com
 * And for the other template:
    1. Don’t show this template in the orders page if the order doesn’t met this condition
    2. Field customer e-mail contains x.com
 * The customer mailaddress is [x@x.x.com](https://wordpress.org/support/topic/conditional-show-button-based-on-e-mail-does-not-work/x@x.x.com?output_format=md)
 * In the order list, I see both templates available to download. How do I fix this?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fconditional-show-button-based-on-e-mail-does-not-work%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [EDGARROJAS](https://wordpress.org/support/users/edgarrojas/)
 * (@edgarrojas)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/conditional-show-button-based-on-e-mail-does-not-work/#post-16990653)
 * Oh weird, could you send me an screenshot of one of the conditions please?
 *  Thread Starter [joeri2023](https://wordpress.org/support/users/joeri2023/)
 * (@joeri2023)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/conditional-show-button-based-on-e-mail-does-not-work/#post-16993088)
 * ![](https://i0.wp.com/whiteboardmaster.shop/wp-content/uploads/2023/08/PDF-invoice.
   png?ssl=1)
 * Here is the screenshot what happens. I removed the mailaddress due to privacy
   concerns
 *  Plugin Author [EDGARROJAS](https://wordpress.org/support/users/edgarrojas/)
 * (@edgarrojas)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/conditional-show-button-based-on-e-mail-does-not-work/#post-16996838)
 * Err sorry i tried to replicate the issue without luck, are you sure you want 
   to use the customer email section?
 * > [SNAG_Program-0015.png](https://imgur.com/KXv77tO)
 * Have in mind that there are other types of emails like billing email and shipping
   email which are not the same as the customer email.
 *  Plugin Author [EDGARROJAS](https://wordpress.org/support/users/edgarrojas/)
 * (@edgarrojas)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/conditional-show-button-based-on-e-mail-does-not-work/#post-16996847)
 * Oh sorry i missed that part in your screenshot but it looks like you want to 
   use the billing email address? If so you first need to create a custom field 
   with this code:
 * return $order->get_billing_email();
 * Then use that custom field in your condition instead of using the customer email.
   I think that will do the trick.
 * Regards!
 *  Thread Starter [joeri2023](https://wordpress.org/support/users/joeri2023/)
 * (@joeri2023)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/conditional-show-button-based-on-e-mail-does-not-work/#post-16999234)
 * Yes, it works on the order page now!

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

The topic ‘Conditional show button based on e-mail does not work’ is closed to new
replies.

 * ![](https://ps.w.org/woo-pdf-invoice-builder/assets/icon-256x256.gif?rev=3517675)
 * [PDF Builder for WooCommerce. Create invoices,packing slips and more](https://wordpress.org/plugins/woo-pdf-invoice-builder/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woo-pdf-invoice-builder/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woo-pdf-invoice-builder/)
 * [Active Topics](https://wordpress.org/support/plugin/woo-pdf-invoice-builder/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woo-pdf-invoice-builder/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woo-pdf-invoice-builder/reviews/)

## Tags

 * [conditional](https://wordpress.org/support/topic-tag/conditional/)

 * 5 replies
 * 2 participants
 * Last reply from: [joeri2023](https://wordpress.org/support/users/joeri2023/)
 * Last activity: [2 years, 9 months ago](https://wordpress.org/support/topic/conditional-show-button-based-on-e-mail-does-not-work/#post-16999234)
 * Status: resolved