Skip to content

Commit

Permalink
Take into account ReplyTo for e-mailings
Browse files Browse the repository at this point in the history
  • Loading branch information
ymollard committed Oct 17, 2024
1 parent 622a296 commit 55592a6
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions htdocs/comm/mailing/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,8 @@

print '<tr class="fieldsforemail"><td>'.$langs->trans("MailErrorsTo").'</td><td><input class="flat minwidth200" name="errorsto" value="'.getDolGlobalString('MAILING_EMAIL_ERRORSTO', getDolGlobalString('MAIN_MAIL_ERRORS_TO')).'"></td></tr>';

print '<tr class="fieldsforemail"><td>'.$langs->trans("MailReply").'</td><td><input class="flat minwidth200" name="replyto" value="'.getDolGlobalString('MAILING_EMAIL_REPLYTO', getDolGlobalString('MAIN_MAIL_REPLY_TO')).'"></td></tr>';

// Other attributes
$parameters = array();
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
Expand Down Expand Up @@ -1029,6 +1031,21 @@

print '</td></tr>';

// Reply to
print '<tr><td>';
print $form->editfieldkey("MailReply", 'email_replyto', $object->email_replyto, $object, $user->hasRight('mailing', 'creer') && $object->statut < 3, 'string');
print '</td><td>';
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 '</td></tr>';

// Errors to
if ($object->messtype != 'sms') {
print '<tr><td>';
Expand Down Expand Up @@ -1375,8 +1392,10 @@
print $langs->trans("MailFrom");
print '</td><td>'.dol_print_email($object->email_from, 0, 0, 0, 0, 1).'</td></tr>';
// To

if ($object->messtype != 'sms') {
print '<tr><td>'.$langs->trans("MailErrorsTo").'</td><td>'.dol_print_email($object->email_errorsto, 0, 0, 0, 0, 1).'</td></tr>';
print '<tr><td>'.$langs->trans("MailReply").'</td><td>'.dol_print_email($object->email_replyto, 0, 0, 0, 0, 1).'</td></tr>';
}

print '</table>';
Expand Down

0 comments on commit 55592a6

Please sign in to comment.