Improvement in the construction of the parameter "From" for the emails
This commit is contained in:
@@ -354,9 +354,23 @@ function _()
|
||||
*/
|
||||
function _FNF(USER_NAME, FIRST_NAME, LAST_NAME, FN_FORMAT)
|
||||
{
|
||||
if (USER_NAME == null) {
|
||||
USER_NAME = '';
|
||||
}
|
||||
if (FIRST_NAME == null) {
|
||||
FIRST_NAME = '';
|
||||
}
|
||||
if (LAST_NAME == null) {
|
||||
LAST_NAME = '';
|
||||
}
|
||||
if (typeof FORMATS != 'undefined') {
|
||||
if (USER_NAME != '' || FIRST_NAME != '' || LAST_NAME != '') {
|
||||
FN_FORMAT = FORMATS.format;
|
||||
}
|
||||
else {
|
||||
FN_FORMAT = '';
|
||||
}
|
||||
}
|
||||
else {
|
||||
FN_FORMAT = '(@lastName, @firstName) @userName';
|
||||
}
|
||||
|
||||
@@ -4532,6 +4532,9 @@ class Cases
|
||||
$sFrom = '"ProcessMaker"';
|
||||
}
|
||||
|
||||
$hasEmailFrom = preg_match('/(.+)@(.+)\.(.+)/', $sFrom, $match);
|
||||
|
||||
if (!$hasEmailFrom || strpos($sFrom, $aConfiguration['MESS_ACCOUNT']) === false) {
|
||||
if (($aConfiguration['MESS_ENGINE'] != 'MAIL') && ($aConfiguration['MESS_ACCOUNT'] != '')) {
|
||||
$sFrom .= ' <' . $aConfiguration['MESS_ACCOUNT'] . '>';
|
||||
} else {
|
||||
@@ -4549,6 +4552,7 @@ class Cases
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($aTaskInfo['TAS_DEF_SUBJECT_MESSAGE']) && $aTaskInfo['TAS_DEF_SUBJECT_MESSAGE'] != '') {
|
||||
$sSubject = G::replaceDataField($aTaskInfo['TAS_DEF_SUBJECT_MESSAGE'], $aFields);
|
||||
|
||||
@@ -791,7 +791,7 @@ class wsBase
|
||||
$sBody = G::replaceDataField( $templateContents, $Fields);
|
||||
$hasEmailFrom = preg_match('/(.+)@(.+)\.(.+)/', $sFrom, $match);
|
||||
|
||||
if (!$hasEmailFrom || strtolower($sFrom) != strtolower($aSetup['MESS_ACCOUNT'])) {
|
||||
if (!$hasEmailFrom || strpos($sFrom, $aSetup['MESS_ACCOUNT']) === false) {
|
||||
$sFrom = '"' . stripslashes($sFrom) . '" <' . $aSetup['MESS_ACCOUNT'] . ">";
|
||||
}
|
||||
|
||||
|
||||
@@ -182,6 +182,9 @@ class AppNotes extends BaseAppNotes {
|
||||
$sFrom = '"ProcessMaker"';
|
||||
}
|
||||
|
||||
$hasEmailFrom = preg_match('/(.+)@(.+)\.(.+)/', $sFrom, $match);
|
||||
|
||||
if (!$hasEmailFrom || strpos($sFrom, $aConfiguration['MESS_ACCOUNT']) === false) {
|
||||
if (($aConfiguration['MESS_ENGINE'] != 'MAIL') && ($aConfiguration['MESS_ACCOUNT'] != '')) {
|
||||
$sFrom .= ' <' . $aConfiguration['MESS_ACCOUNT'] . '>';
|
||||
} else {
|
||||
@@ -199,6 +202,7 @@ class AppNotes extends BaseAppNotes {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$sSubject = G::replaceDataField($configNoteNotification['subject'], $aFields);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user