Adding custom clients to email module

Hey,

Right now when I’m on the email module and I click, create an email, when you click FOR, it pop ups a new window with all the clients, accounts, etc… My question is how can I add custom modules there, I’m adding a picture in case I didn’t explain well enough.

Thanks

Hey,

I think I found the file to do this, it is in /modules/Emails/EmailUI.php:
Line 494:


//Relateable List of People for address book search
		//#20776 jchi
		$peopleTables = array("users",
		                      "contacts",
		                      "leads",
		                      "prospects",
		                      "accounts",
							  "MYNEWMODULE",
							  "MYNEWMODULE2");
		$filterPeopleTables = array();
		global $app_list_strings, $app_strings;
		$filterPeopleTables['LBL_DROPDOWN_LIST_ALL'] = $app_strings['LBL_DROPDOWN_LIST_ALL'];
		foreach($peopleTables as $table) {
			
				$module = ucfirst($table);
				$class = substr($module, 0, strlen($module) - 1);
			
            
            require_once("modules/{$module}/{$class}.php");
			echo $class;
            $person = new $class();

            if (!$person->ACLAccess('list')) continue;
            $filterPeopleTables[$person->table_name] = $app_list_strings['moduleList'][$person->module_dir];
		}
		$this->smarty->assign('listOfPersons' , get_select_options_with_id($filterPeopleTables,''));

But it is not working, some help please!

Thanks

Sorry, I didn’t expecify what it’s not working, in the list when I click in one of my new modules, and click search, it gives me this error in f12:

“NetworkError: 500 Internal Server Error - http://WEB.com/index.php?to_pdf=true&module=Emails&action=EmailUIAjax&emailUIAction=getAddressSearchResults&related_bean_id=&search_field=&person=NEWMODULE&