Skip to content

Commit

Permalink
Mode hook
Browse files Browse the repository at this point in the history
in $conf->global->MAIN_DISABLE_ALL_MAILS
  • Loading branch information
Alexis ALGOUD committed Jul 5, 2015
1 parent 25842b3 commit 1277596
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions htdocs/core/class/CMailFile.class.php
Expand Up @@ -373,21 +373,22 @@ function sendfile()

$res=false;

dol_include_once('/core/class/hookmanager.class.php');
$hookmanager=new HookManager($db);
$hookmanager->initHooks(array('maildao'));
$reshook=$hookmanager->executeHooks('doactions',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
if (!empty($reshook))
{

$this->error="Error in hook maildao doactions ".$reshook;
dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR);

return $reshook;
}

if (empty($conf->global->MAIN_DISABLE_ALL_MAILS))
{

dol_include_once('/core/class/hookmanager.class.php');
$hookmanager=new HookManager($db);
$hookmanager->initHooks(array('maildao'));
$reshook=$hookmanager->executeHooks('doactions',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
if (!empty($reshook))
{

$this->error="Error in hook maildao doactions ".$reshook;
dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR);

return $reshook;
}

// Action according to choosed sending method
if ($conf->global->MAIN_MAIL_SENDMODE == 'mail')
{
Expand Down

0 comments on commit 1277596

Please sign in to comment.