# Email Manager

The [**Email Manager**](/masterstudy-lms/lms-pro-addons/email-manager.md) addon provides filters that let you customize email templates and adjust the available settings within the email manager interface. Use these hooks to modify default subjects, add new configuration fields, or override existing ones.

## Filters

1. `stm_lms_email_manager_emails`

**Type:** filter\
**What it does:** lets you change the default email templates and their values (for example, subject lines or message bodies)\
**Parameters:**

* `$emails` (array) list of email templates and their data

**Return:** array of updated emails

**Example:**

```php
add_filter( 'stm_lms_email_manager_emails', 'stm_lms_email_manager_emails_function',  10, 1 );

function stm_lms_email_manager_emails_function($emails){
    if ( ! empty( $emails['stm_lms_course_added'] ) ) {
        $emails['stm_lms_course_added']['subject'] = 'New course added';
    }

    return $emails;
}
```

2. `stm_lms_email_manager_settings`

**Type:** filter\
**What it does:** allows you to extend or modify the settings available in the Email Manager settings menu\
**Parameters:**

* `$data` (array) existing settings data

**Return:** array of updated settings

**Example:**

```php
dd_filter( 'stm_lms_email_manager_settings', 'stm_lms_email_manager_settings_function', 10, 1 );
	function stm_lms_email_manager_settings_function($data) {
		
$email_branding = array(
   'upcoming-course-status' => array(
      'name'   => 'Upcoming',
      'fields' => array(
         'masterstudy_lms_coming_soon_pre_sale_hidden'   => array(
            'type'  => 'send_email',
            'group' => 'ended',
            'label' => esc_html__( 'Hidden', 'masterstudy-lms-learning-management-system-pro' ),
            'value' => 'masterstudy_lms_coming_soon_pre_sale',
         ),
         'masterstudy_lms_coming_soon_start_date_hidden'   => array(
            'type'  => 'send_email',
            'group' => 'ended',
            'label' => esc_html__( 'Hidden', 'masterstudy-lms-learning-management-system-pro' ),
            'value' => 'masterstudy_lms_coming_soon_start_date',
         ),
      ),
   ),
);


return array_merge( $settings, $email_branding );
}
```


---

# 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.stylemixthemes.com/masterstudy-lms/developers-guide/masterstudy-lms-hooks/email-manager.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.
