From 1874deef49a699bd5928fa4cf2b30513917e8e5f Mon Sep 17 00:00:00 2001 From: VIAL-GOUTEYRON Quentin Date: Thu, 18 Sep 2025 13:23:57 +0200 Subject: [PATCH] FIX delivery triggers and mail templates: correct inconsistencies in email triggers and templates` (#35264) * `fix(delivery): correct inconsistencies in email triggers and templates` **Body:** - Adjusted email trigger names from `RECEPTION_*` to `SHIPPING_*`. - Updated parameters and placeholders for shipment email tracking. - Removed redundant `reception_send` entry in mail templates for shipping. * `fix(delivery): update email triggers and templates for deliveries` **Body:** - Replaced email trigger `SHIPPING_SENTBYMAIL` with `DELIVERY_SENTBYMAIL`. - Updated template references from `shipping_*` to `delivery_*` for consistency. - Modified tracking ID format from `shi` to `del` in `card.php`. - Added `MailToSendDelivery` language entry for email labels. - Adjusted mail templates to include `delivery_send` entries. --- htdocs/admin/mails_templates.php | 2 +- htdocs/delivery/card.php | 16 ++++++++-------- htdocs/langs/en_US/admin.lang | 1 + htdocs/langs/en_US/sendings.lang | 1 + 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 417e609b1cd..a32bfc7a3e4 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -219,7 +219,7 @@ if (isModEnabled('invoice') && $user->hasRight('facture', 'lire')) { } if (isModEnabled("shipping")) { $elementList['shipping_send'] = img_picto('', 'dolly', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendShipment')); - $elementList['reception_send'] = img_picto('', 'dolly', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendReception')); + $elementList['delivery_send'] = img_picto('', 'dolly', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendDelivery')); } if (isModEnabled("reception")) { $elementList['reception_send'] = img_picto('', 'dollyrevert', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendReception')); diff --git a/htdocs/delivery/card.php b/htdocs/delivery/card.php index a91c9f4eee3..c25342438d2 100644 --- a/htdocs/delivery/card.php +++ b/htdocs/delivery/card.php @@ -284,11 +284,11 @@ include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; // Actions to send emails -$triggersendname = 'RECEPTION_SENTBYMAIL'; +$triggersendname = 'DELIVERY_SENTBYMAIL'; $paramname = 'id'; -$autocopy = 'MAIN_MAIL_AUTOCOPY_RECEPTION_TO'; -$mode = 'emailfromreception'; -$trackid = 'bl' . $object->id; +$autocopy = 'MAIN_MAIL_AUTOCOPY_DELIVERY_TO'; +$mode = 'emailfromdelivery'; +$trackid = 'del' . $object->id; include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php'; @@ -759,10 +759,10 @@ if ($action == 'create') { } // Presend form - $modelmail = 'reception_send'; - $defaulttopic = 'SendReceptionRef'; - $diroutput = $conf->expedition->dir_output.'/receipt'; - $trackid = 'bl'.$object->id; + $modelmail = 'delivery_send'; + $defaulttopic = 'SendDeliveryRef'; + $diroutput = $conf->expedition->dir_output . '/receipt'; + $trackid = 'del' . $object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; } diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 32a80c39e9c..24af49e8346 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2102,6 +2102,7 @@ MailToSendProposal=Customer proposals MailToSendOrder=Sales orders MailToSendInvoice=Customer invoices MailToSendShipment=Shipments +MailToSendDelivery=Deliveries MailToSendIntervention=Interventions MailToSendSupplierRequestForQuotation=Quotation request MailToSendSupplierOrder=Purchase orders diff --git a/htdocs/langs/en_US/sendings.lang b/htdocs/langs/en_US/sendings.lang index c43873bff78..089ccdb4f6e 100644 --- a/htdocs/langs/en_US/sendings.lang +++ b/htdocs/langs/en_US/sendings.lang @@ -51,6 +51,7 @@ DateReceived=Date delivery received ClassifyReception=Classify Received SendShippingByEMail=Send shipment by email SendShippingRef=Submission of shipment %s +SendDeliveryRef=Submission of delivery %s ActionsOnShipping=Events on shipment LinkToTrackYourPackage=Link to track your package ShipmentCreationIsDoneFromOrder=For the moment, creation of a new shipment is done from the Sales Order record.