# Register New Conditional Logic

To register a new conditional logic, developers should use the following code:

```php
function register_conditional_logic( $conditional_logics ) {
    $conditional_logics->register( NewConditionalLogic::get_instance()->get_logic_data() );
}

add_action( 'yaymail_register_conditional_logics', 'register_conditional_logic' );
```

This code attaches to the `yaymail_register_conditional_logics` action hook. It is used to register new conditional logic by passing an array value of the instance class.

For more details, you can check our tutorial video below.

{% embed url="<https://youtu.be/TcvubJOpAKI>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.yaycommerce.com/yaymail/addons/conditional-logic/register-new-conditional-logic.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
