Merge pull request #9820 from laudeco/hotfix/9640_member_email

FIX the member e-mail on resign and validation.
This commit is contained in:
Laurent Destailleur
2018-10-30 12:41:34 +01:00
committed by GitHub
2 changed files with 49 additions and 33 deletions

View File

@@ -634,19 +634,27 @@ if (empty($reshook))
$msg = $arraydefaultmessage->content; $msg = $arraydefaultmessage->content;
} }
$substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object); if (empty($labeltouse) || (int)$labeltouse === -1) {
complete_substitutions_array($substitutionarray, $outputlangs, $object); //fallback on the old configuration.
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); setEventMessages('WarningMandatorySetupNotComplete', [], 'errors');
$texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnValid()), $substitutionarray, $outputlangs); $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');
}
}
$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
@@ -707,20 +715,28 @@ if (empty($reshook))
$msg = $arraydefaultmessage->content; $msg = $arraydefaultmessage->content;
} }
$substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object); if (empty($labeltouse) || (int)$labeltouse === -1) {
complete_substitutions_array($substitutionarray, $outputlangs, $object); //fallback on the old configuration.
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); setEventMessages('WarningMandatorySetupNotComplete', [], 'errors');
$texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnResiliate()), $substitutionarray, $outputlangs); $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');
}
}
}
$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
{ {

View File

@@ -6530,7 +6530,7 @@ function get_htmloutput_mesg($mesgstring='',$mesgarray='', $style='ok', $keepemb
/** /**
* Get formated error messages to output (Used to show messages on html output). * Get formated error messages to output (Used to show messages on html output).
* *
* @param string $mesgstring Error message * @param string $mesgstring Error message
* @param array $mesgarray Error messages array * @param array $mesgarray Error messages array
* @param int $keepembedded Set to 1 in error message must be kept embedded into its html place (this disable jnotify) * @param int $keepembedded Set to 1 in error message must be kept embedded into its html place (this disable jnotify)
* @return string Return html output * @return string Return html output
@@ -6538,7 +6538,7 @@ function get_htmloutput_mesg($mesgstring='',$mesgarray='', $style='ok', $keepemb
* @see dol_print_error * @see dol_print_error
* @see dol_htmloutput_mesg * @see dol_htmloutput_mesg
*/ */
function get_htmloutput_errors($mesgstring='', $mesgarray='', $keepembedded=0) function get_htmloutput_errors($mesgstring='', $mesgarray=array(), $keepembedded=0)
{ {
return get_htmloutput_mesg($mesgstring, $mesgarray,'error',$keepembedded); return get_htmloutput_mesg($mesgstring, $mesgarray,'error',$keepembedded);
} }
@@ -6548,15 +6548,15 @@ function get_htmloutput_errors($mesgstring='', $mesgarray='', $keepembedded=0)
* *
* @param string $mesgstring Message string or message key * @param string $mesgstring Message string or message key
* @param string[] $mesgarray Array of message strings or message keys * @param string[] $mesgarray Array of message strings or message keys
* @param string $style Which style to use ('ok', 'warning', 'error') * @param string $style Which style to use ('ok', 'warning', 'error')
* @param int $keepembedded Set to 1 if message must be kept embedded into its html place (this disable jnotify) * @param int $keepembedded Set to 1 if message must be kept embedded into its html place (this disable jnotify)
* @return void * @return void
* *
* @see dol_print_error * @see dol_print_error
* @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 = array(), $style = 'ok', $keepembedded=0)
{ {
if (empty($mesgstring) && (! is_array($mesgarray) || count($mesgarray) == 0)) return; if (empty($mesgstring) && (! is_array($mesgarray) || count($mesgarray) == 0)) return;
@@ -6610,7 +6610,7 @@ function dol_htmloutput_mesg($mesgstring='',$mesgarray='', $style='ok', $keepemb
* @see dol_print_error * @see dol_print_error
* @see dol_htmloutput_mesg * @see dol_htmloutput_mesg
*/ */
function dol_htmloutput_errors($mesgstring='', $mesgarray='', $keepembedded=0) function dol_htmloutput_errors($mesgstring='', $mesgarray=array(), $keepembedded=0)
{ {
dol_htmloutput_mesg($mesgstring, $mesgarray, 'error', $keepembedded); dol_htmloutput_mesg($mesgstring, $mesgarray, 'error', $keepembedded);
} }