From 55592a6960b5e359b6e70af9c56f843b5614b99b Mon Sep 17 00:00:00 2001 From: Yoan Mollard Date: Fri, 18 Oct 2024 00:43:55 +0200 Subject: [PATCH] Take into account ReplyTo for e-mailings --- htdocs/comm/mailing/card.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index cc46110e17c9d..2f75c41392566 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -833,6 +833,8 @@ print ''.$langs->trans("MailErrorsTo").''; + print ''.$langs->trans("MailReply").''; + // Other attributes $parameters = array(); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook @@ -1029,6 +1031,21 @@ print ''; + // Reply to + print ''; + print $form->editfieldkey("MailReply", 'email_replyto', $object->email_replyto, $object, $user->hasRight('mailing', 'creer') && $object->statut < 3, 'string'); + print ''; + print $form->editfieldval("MailReply", 'email_replyto', $object->email_replyto, $object, $user->hasRight('mailing', 'creer') && $object->statut < 3, 'string'); + $email = CMailFile::getValidAddress($object->email_replyto, 2); + if ($email && !isValidEmail($email)) { + $langs->load("errors"); + print img_warning($langs->trans("ErrorBadEMail", $email)); + } elseif ($email && !isValidMailDomain($email)) { + $langs->load("errors"); + print img_warning($langs->trans("ErrorBadMXDomain", $email)); + } + print ''; + // Errors to if ($object->messtype != 'sms') { print ''; @@ -1375,8 +1392,10 @@ print $langs->trans("MailFrom"); print ''.dol_print_email($object->email_from, 0, 0, 0, 0, 1).''; // To + if ($object->messtype != 'sms') { print ''.$langs->trans("MailErrorsTo").''.dol_print_email($object->email_errorsto, 0, 0, 0, 0, 1).''; + print ''.$langs->trans("MailReply").''.dol_print_email($object->email_replyto, 0, 0, 0, 0, 1).''; } print '';