> For the complete documentation index, see [llms.txt](https://docs.yaycommerce.com/yaymail/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.yaycommerce.com/yaymail/developer-zone/snippets/enable-disable-specific-elements-in-selected-email-template.md).

# Enable/Disable specific elements in selected email template

Here's the code used to enable/disable specific elements in selected email template

```
add_filter( 'yaymail_element_available_email_ids', function( $available_email_ids, $element ) {
	if ( 'order_details_download' === $element->get_type() ) {
            $available_email_ids[] = \YayMail\Emails\CustomerInvoice::get_instance()->get_id();
        }

        return $available_email_ids;
}, 10, 2 );
```

Below is the list of corresponding name variables:

* New order: NewOrder
* Cancelled order: CancelledOrder
* Failed order (Admin): FailedOrder
* Failed order (Customer): CustomerFailedOrder
* Processing order: CustomerProcessingOrder
* Order on-hold: CustomerOnHoldOrder
* Completed order: CustomerCompletedOrder
* Refunded order: CustomerRefundedOrder
* Order details: CustomerInvoice
* Customer note: CustomerNote
* Reset password: CustomerResetPassword
* New account: CustomerNewAccount

Alternatively, instead of using **`$available_email_ids[] = \YayMail\Emails\CustomerInvoice::get_instance()->get_id();`**, you can replace it with **`$available_email_ids[] = wc_email_id;`**

\
Below is the list of variables:

`new_order`\
`cancelled_order`\
`failed_order`\
`customer_failed_order`\
`customer_on_hold_order`\
`customer_processing_order`\
`customer_completed_order`\
`customer_refunded_order`\
`customer_invoice`\
`customer_note`\
`customer_reset_password`\
`customer_new_account`<br>
