forked from Wavyzz/dolibarr
set a message
This commit is contained in:
@@ -634,25 +634,27 @@ if (empty($reshook))
|
|||||||
$msg = $arraydefaultmessage->content;
|
$msg = $arraydefaultmessage->content;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($labeltouse)) {
|
if (empty($labeltouse) || (int)$labeltouse === -1) {
|
||||||
//fallback on the old configuration.
|
//fallback on the old configuration.
|
||||||
$subject = $conf->global->ADHERENT_MAIL_VALID_SUBJECT;
|
setEventMessages('WarningMandatorySetupNotComplete', [], 'errors');
|
||||||
$msg = $conf->global->ADHERENT_MAIL_VALID;
|
$error++;
|
||||||
|
}else{
|
||||||
|
$substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object);
|
||||||
|
complete_substitutions_array($substitutionarray, $outputlangs, $object);
|
||||||
|
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
|
||||||
|
$texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnValid()), $substitutionarray, $outputlangs);
|
||||||
|
|
||||||
|
$moreinheader='X-Dolibarr-Info: send_an_email by adherents/card.php'."\r\n";
|
||||||
|
|
||||||
|
$result=$object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1, '', $moreinheader);
|
||||||
|
if ($result < 0)
|
||||||
|
{
|
||||||
|
$error++;
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object);
|
|
||||||
complete_substitutions_array($substitutionarray, $outputlangs, $object);
|
|
||||||
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
|
|
||||||
$texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnValid()), $substitutionarray, $outputlangs);
|
|
||||||
|
|
||||||
$moreinheader='X-Dolibarr-Info: send_an_email by adherents/card.php'."\r\n";
|
|
||||||
|
|
||||||
$result=$object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1, '', $moreinheader);
|
|
||||||
if ($result < 0)
|
|
||||||
{
|
|
||||||
$error++;
|
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -713,26 +715,28 @@ if (empty($reshook))
|
|||||||
$msg = $arraydefaultmessage->content;
|
$msg = $arraydefaultmessage->content;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($labeltouse)) {
|
if (empty($labeltouse) || (int)$labeltouse === -1) {
|
||||||
//fallback on the old configuration.
|
//fallback on the old configuration.
|
||||||
$subject = $conf->global->ADHERENT_MAIL_RESIL_SUBJECT;
|
setEventMessages('WarningMandatorySetupNotComplete', [], 'errors');
|
||||||
$msg = $conf->global->ADHERENT_MAIL_RESIL;
|
$error++;
|
||||||
|
}else{
|
||||||
|
$substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object);
|
||||||
|
complete_substitutions_array($substitutionarray, $outputlangs, $object);
|
||||||
|
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
|
||||||
|
$texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnResiliate()), $substitutionarray, $outputlangs);
|
||||||
|
|
||||||
|
$moreinheader='X-Dolibarr-Info: send_an_email by adherents/card.php'."\r\n";
|
||||||
|
|
||||||
|
$result=$object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1, '', $moreinheader);
|
||||||
|
if ($result < 0)
|
||||||
|
{
|
||||||
|
$error++;
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object);
|
|
||||||
complete_substitutions_array($substitutionarray, $outputlangs, $object);
|
|
||||||
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
|
|
||||||
$texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnResiliate()), $substitutionarray, $outputlangs);
|
|
||||||
|
|
||||||
$moreinheader='X-Dolibarr-Info: send_an_email by adherents/card.php'."\r\n";
|
|
||||||
|
|
||||||
$result=$object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1, '', $moreinheader);
|
|
||||||
}
|
|
||||||
if ($result < 0)
|
|
||||||
{
|
|
||||||
$error++;
|
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6555,7 +6555,7 @@ function get_htmloutput_errors($mesgstring='', $mesgarray='', $keepembedded=0)
|
|||||||
* @see dol_htmloutput_errors
|
* @see dol_htmloutput_errors
|
||||||
* @see setEventMessages
|
* @see setEventMessages
|
||||||
*/
|
*/
|
||||||
function dol_htmloutput_mesg($mesgstring='',$mesgarray='', $style='ok', $keepembedded=0)
|
function dol_htmloutput_mesg($mesgstring = '',$mesgarray = [], $style = 'ok', $keepembedded=0)
|
||||||
{
|
{
|
||||||
if (empty($mesgstring) && (! is_array($mesgarray) || count($mesgarray) == 0)) return;
|
if (empty($mesgstring) && (! is_array($mesgarray) || count($mesgarray) == 0)) return;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user