feat: ajout fichier traiter_pieces_jointes pour ajouter des pieces jointes avant l'envoi, utilie si on utilise envoi_separe

This commit is contained in:
Christophe 2023-03-31 08:08:56 +02:00
parent 35584c2a49
commit 143faff6c4

View file

@ -276,7 +276,7 @@ function gamuSend($slug, $options, $destinataires, $Tclient, $Tpdf, $redirect, &
if (!empty($docs_spip)) { if (!empty($docs_spip)) {
foreach ($docs_spip as $id_document) { foreach ($docs_spip as $id_document) {
$protected = ''; $protected = '';
$Tdocument = sql_fetsel('*','spip_documents','id_document='.intval($id_document)); $Tdocument = sql_fetsel('*','spip_documents','id_document='.intval($id_document));
if ( if (
array_key_exists('protected', $Tdocument) array_key_exists('protected', $Tdocument)
and $Tdocument['protected'] === 'oui' and $Tdocument['protected'] === 'oui'
@ -349,6 +349,20 @@ function gamuSend($slug, $options, $destinataires, $Tclient, $Tpdf, $redirect, &
]; ];
} }
} }
if ($f = charger_fonction('traiter_pieces_jointes', 'gamumail', true)) {
$pc = $f($options, $destinataires, $Tclient, $Tpdf);
if (!empty($pc)) {
$pieces_jointes[] = $pc;
}
}
if ($f = charger_fonction($slug . '_traiter_pieces_jointes', 'gamumail', true)) {
$pc = $f($options, $destinataires, $Tclient, $Tpdf);
if (!empty($pc)) {
$pieces_jointes[] = $pc;
}
}
$html_header = ''; $html_header = '';
if (find_in_path('gamumail/'.$slug .'_html_header.html')) { if (find_in_path('gamumail/'.$slug .'_html_header.html')) {
$html_header = recuperer_fond('gamumail/'.$slug . '_html_header', $options); $html_header = recuperer_fond('gamumail/'.$slug . '_html_header', $options);