Fix substitution of __EMAIL__
This commit is contained in:
parent
73a799b0ce
commit
075a138e14
@ -61,7 +61,7 @@ $object->substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation
|
|||||||
|
|
||||||
$object->substitutionarrayfortest=array(
|
$object->substitutionarrayfortest=array(
|
||||||
'__ID__' => 'TESTIdRecord',
|
'__ID__' => 'TESTIdRecord',
|
||||||
'__EMAIL__' => 'TESTEMail',
|
//'__EMAIL__' => 'TESTEMail', // Done into "send" action
|
||||||
'__LASTNAME__' => 'TESTLastname',
|
'__LASTNAME__' => 'TESTLastname',
|
||||||
'__FIRSTNAME__' => 'TESTFirstname',
|
'__FIRSTNAME__' => 'TESTFirstname',
|
||||||
'__MAILTOEMAIL__' => 'TESTMailtoEmail',
|
'__MAILTOEMAIL__' => 'TESTMailtoEmail',
|
||||||
@ -409,6 +409,8 @@ if (empty($reshook))
|
|||||||
$msgishtml=-1; // Inconnu par defaut
|
$msgishtml=-1; // Inconnu par defaut
|
||||||
if (preg_match('/[\s\t]*<html>/i',$object->body)) $msgishtml=1;
|
if (preg_match('/[\s\t]*<html>/i',$object->body)) $msgishtml=1;
|
||||||
|
|
||||||
|
$object->substitutionarrayfortest['__EMAIL__'] = $object->sendto; // other are set at begin of page
|
||||||
|
|
||||||
// Pratique les substitutions sur le sujet et message
|
// Pratique les substitutions sur le sujet et message
|
||||||
$tmpsujet=make_substitutions($object->sujet,$object->substitutionarrayfortest);
|
$tmpsujet=make_substitutions($object->sujet,$object->substitutionarrayfortest);
|
||||||
$tmpbody=make_substitutions($object->body,$object->substitutionarrayfortest);
|
$tmpbody=make_substitutions($object->body,$object->substitutionarrayfortest);
|
||||||
|
|||||||
@ -178,7 +178,7 @@ class CMailFile
|
|||||||
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
|
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
|
||||||
|
|
||||||
// Replace relative /viewimage to absolute path
|
// Replace relative /viewimage to absolute path
|
||||||
$msg = preg_replace('/src="'.preg_quote(DOL_URL_ROOT,'/').'\/viewimage\.php/', 'src="'.$urlwithroot.'/viewimage.php', $msg, -1, $nbrep);
|
$msg = preg_replace('/src="'.preg_quote(DOL_URL_ROOT,'/').'\/viewimage\.php/ims', 'src="'.$urlwithroot.'/viewimage.php', $msg, -1, $nbrep);
|
||||||
|
|
||||||
if (! empty($conf->global->MAIN_MAIL_FORCE_CONTENT_TYPE_TO_HTML)) $this->msgishtml=1; // To force to send everything with content type html.
|
if (! empty($conf->global->MAIN_MAIL_FORCE_CONTENT_TYPE_TO_HTML)) $this->msgishtml=1; // To force to send everything with content type html.
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user