I´ve got an Inbound email handler that creates Cases from emails. Trying to change the Teams on my Email record from the Administrator and salesdistro teams over to Global. This is the code but it´s not working, seem´s like the Logic Hook is never triggered:
In /custom/modules/Emails/Ext/LogicHooks I have the file EmailLogicHookCustom.ext.php:
$hook_version = 1;
$hook_array['after_save'] = Array(1,'Change Team to
And then in /custom/modules/Emails is the file EmLogicHookCustom.php:
if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
function changeteam($bean, $event, $arguments)
$primary_team_id = '1';
//loop prevention check
if (!isset($bean->ignore_update_c) || $bean->ignore_update_c === false)
$bean->team_id = $primary_team_id;
$bean->ignore_update_c = true;
Same kind of code is working just fine in changing the Team on Cases.
What am I missing here?
Are emails handled differently than other records?
Thanks so much,
P.s. Sugar 8.0.2