Fix the from robot must be visible only on test page
This commit is contained in:
parent
3d48e509bd
commit
5935ad868a
@ -728,12 +728,13 @@ else
|
||||
// Cree l'objet formulaire mail
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||
$formmail = new FormMail($db);
|
||||
$formmail->trackid=(($action == 'testhtml')?"testhtml":"test");
|
||||
$formmail->fromname = (isset($_POST['fromname'])?$_POST['fromname']:$conf->global->MAIN_MAIL_EMAIL_FROM);
|
||||
$formmail->frommail = (isset($_POST['frommail'])?$_POST['frommail']:$conf->global->MAIN_MAIL_EMAIL_FROM);
|
||||
$formmail->fromid=$user->id;
|
||||
$formmail->trackid=(($action == 'testhtml')?"testhtml":"test");
|
||||
$formmail->withfromreadonly=1;
|
||||
$formmail->fromalsorobot=1;
|
||||
$formmail->fromtype=(GETPOST('fromtype')?GETPOST('fromtype'):(!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE)?$conf->global->MAIN_MAIL_DEFAULT_FROMTYPE:'user'));
|
||||
$formmail->withfromreadonly=1;
|
||||
$formmail->withsubstit=0;
|
||||
$formmail->withfrom=1;
|
||||
$formmail->witherrorsto=1;
|
||||
|
||||
@ -472,6 +472,19 @@ class FormMail extends Form
|
||||
// Add also email aliases if there is some
|
||||
$listaliases=array('user_aliases'=>$user->email_aliases, 'global_aliases'=>$conf->global->MAIN_INFO_SOCIETE_MAIL_ALIASES);
|
||||
|
||||
// Also add robot email
|
||||
if (! empty($this->fromalsorobot))
|
||||
{
|
||||
if (! empty($conf->global->MAIN_MAIL_EMAIL_FROM) && $conf->global->MAIN_MAIL_EMAIL_FROM != $conf->global->MAIN_INFO_SOCIETE_MAIL)
|
||||
{
|
||||
$liste['robot'] = $conf->global->MAIN_MAIL_EMAIL_FROM;
|
||||
if ($this->frommail)
|
||||
{
|
||||
$liste['robot'] .= ' <'.$conf->global->MAIN_MAIL_EMAIL_FROM.'>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add also email aliases from the c_email_senderprofile table
|
||||
$sql='SELECT rowid, label, email FROM '.MAIN_DB_PREFIX.'c_email_senderprofile WHERE active = 1 ORDER BY position';
|
||||
$resql = $this->db->query($sql);
|
||||
@ -491,16 +504,6 @@ class FormMail extends Form
|
||||
}
|
||||
else dol_print_error($this->db);
|
||||
|
||||
// Also add robot email
|
||||
if (! empty($conf->global->MAIN_MAIL_EMAIL_FROM) && $conf->global->MAIN_MAIL_EMAIL_FROM != $conf->global->MAIN_INFO_SOCIETE_MAIL)
|
||||
{
|
||||
$liste['robot'] = $conf->global->MAIN_MAIL_EMAIL_FROM;
|
||||
if ($this->frommail)
|
||||
{
|
||||
$liste['robot'] .= ' <'.$conf->global->MAIN_MAIL_EMAIL_FROM.'>';
|
||||
}
|
||||
}
|
||||
|
||||
foreach($listaliases as $typealias => $listalias)
|
||||
{
|
||||
$posalias=0;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user