Upgrade-safe Customization of EmailMan:
custom/modules/EmailMan/CustomEmailMan.php
<?php
$customBeanList['EmailMan'] = 'CustomEmailMan';
$customObjectList['EmailMan'] = 'CustomEmailMan';
$customBeanFiles['EmailMan'] = 'custom/modules/EmailMan/CustomEmailMan.php';
?>
Check that this gets pulled into
custom/application/Ext/Include/modules.ext.php
with a QR&R.
Then put your custom class in
custom/modules/EmailMan/CustomEmailMan.php
<?php
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
require_once 'modules/EmailMan/EmailMan.php';
class CustomEmailMan extends EmailMan {
public function sendEmail(SugarPHPMailer $mail, $save_emails = 1) {
... [override code here, perhaps call parent function] ...
}
}
The above is an example overriding the sendEmail
function, but you can do it for any member function.