Hooks intégrés dans develop (pour la v10 ?)

This commit is contained in:
Chl 2019-02-28 02:05:20 +01:00
parent d0991fb220
commit dbb7acfb8f
2 changed files with 9 additions and 4 deletions

View file

@ -73,7 +73,7 @@ class Actionssendfacrecmail
* @param HookManager $hookmanager Hook manager propagated to allow calling another hook
* @return int < 0 on error, 0 on success, 1 to replace standard code
*/
public function generatedInvoice($parameters, &$object, &$action, $hookmanager)
public function afterCreationOfRecurringInvoice($parameters, &$object, &$action, $hookmanager)
{
global $conf, $user, $langs;
$langs->load('mails');
@ -86,6 +86,11 @@ class Actionssendfacrecmail
if ($object->brouillon) {
return 0;
}
// On n'envoie évidemment pas s'il n'y a pas d'adresse email renseignée
if (empty($object->thirdparty->email)) {
dol_syslog("Empty email for thirdparty " . $object->thirdparty->id . ". Not sending facturerec " . $facturerec->ref . " (id:" . $facturerec->id . ").");
return 0;
}
// récupération du template du mail
// (pas très précise mais je commence à en avoir marre de creuser tout dolibarr pour trouver les bonnes fonctions...)