diff --git a/htdocs/comm/mailing/fiche.php b/htdocs/comm/mailing/fiche.php index 741ef4c2a1c..5fe8980c7ec 100644 --- a/htdocs/comm/mailing/fiche.php +++ b/htdocs/comm/mailing/fiche.php @@ -63,6 +63,18 @@ if ($_POST["action"] == 'send') $mil->sujet = $_POST["subject"]; $mil->body = $_POST["message"]; + if (! $mil->sendto) + { + $message='
'.$langs->trans("ErrorFieldRequired",$langs->trans("MailTo")).'
'; + } + if (! $mil->sujet) + { + $message='
'.$langs->trans("ErrorFieldRequired",$langs->trans("MailTopic")).'
'; + } + if (! $mil->body) + { + $message='
'.$langs->trans("ErrorFieldRequired",$langs->trans("MailMessage")).'
'; + } if ($mil->sendto && $mil->sujet && $mil->body) { require_once(DOL_DOCUMENT_ROOT."/lib/CMailFile.class.php"); @@ -96,11 +108,6 @@ if ($_POST["action"] == 'send') $_GET["action"]=''; $_GET["id"]=$mil->id; } - else - { - $message='
'.$langs->trans("ErrorUnknown").'
'; - } - } // Action ajout mailing diff --git a/htdocs/includes/modules/mailings/README b/htdocs/includes/modules/mailings/README index 9a80df128e1..f0abdae931d 100644 --- a/htdocs/includes/modules/mailings/README +++ b/htdocs/includes/modules/mailings/README @@ -43,5 +43,5 @@ $target[n]=array('email'=>'email_n','name'=>'name_n','firstname'=>'firstname_n') ***** STEP 3 ***** Once this file has been edited, you can go to the Dolibarr emailing feature, -you will see a new line selector in the "target" editor of emailings. +you will see a new line selector in the "targets" editor of emailing tool.