Improvement in the construction of the parameter "From" for the emails
This commit is contained in:
@@ -354,8 +354,22 @@ function _()
|
|||||||
*/
|
*/
|
||||||
function _FNF(USER_NAME, FIRST_NAME, LAST_NAME, FN_FORMAT)
|
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 (typeof FORMATS != 'undefined') {
|
||||||
FN_FORMAT = FORMATS.format;
|
if (USER_NAME != '' || FIRST_NAME != '' || LAST_NAME != '') {
|
||||||
|
FN_FORMAT = FORMATS.format;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
FN_FORMAT = '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
FN_FORMAT = '(@lastName, @firstName) @userName';
|
FN_FORMAT = '(@lastName, @firstName) @userName';
|
||||||
|
|||||||
@@ -4529,25 +4529,29 @@ class Cases
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($sFrom == '') {
|
if ($sFrom == '') {
|
||||||
$sFrom = '"ProcessMaker"';
|
$sFrom = '"ProcessMaker"';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($aConfiguration['MESS_ENGINE'] != 'MAIL') && ($aConfiguration['MESS_ACCOUNT'] != '')) {
|
$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'] . '>';
|
$sFrom .= ' <' . $aConfiguration['MESS_ACCOUNT'] . '>';
|
||||||
} else {
|
} else {
|
||||||
if (($aConfiguration['MESS_ENGINE'] == 'MAIL')) {
|
if (($aConfiguration['MESS_ENGINE'] == 'MAIL')) {
|
||||||
$sFrom .= ' <info@' . gethostbyaddr('127.0.0.1') . '>';
|
$sFrom .= ' <info@' . gethostbyaddr('127.0.0.1') . '>';
|
||||||
} else {
|
} else {
|
||||||
if ($aConfiguration['MESS_SERVER'] != '') {
|
if ($aConfiguration['MESS_SERVER'] != '') {
|
||||||
if (($sAux = @gethostbyaddr($aConfiguration['MESS_SERVER']))) {
|
if (($sAux = @gethostbyaddr($aConfiguration['MESS_SERVER']))) {
|
||||||
$sFrom .= ' <info@' . $sAux . '>';
|
$sFrom .= ' <info@' . $sAux . '>';
|
||||||
} else {
|
|
||||||
$sFrom .= ' <info@' . $aConfiguration['MESS_SERVER'] . '>';
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
$sFrom .= ' <info@processmaker.com>';
|
$sFrom .= ' <info@' . $aConfiguration['MESS_SERVER'] . '>';
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$sFrom .= ' <info@processmaker.com>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($aTaskInfo['TAS_DEF_SUBJECT_MESSAGE']) && $aTaskInfo['TAS_DEF_SUBJECT_MESSAGE'] != '') {
|
if (isset($aTaskInfo['TAS_DEF_SUBJECT_MESSAGE']) && $aTaskInfo['TAS_DEF_SUBJECT_MESSAGE'] != '') {
|
||||||
|
|||||||
@@ -791,7 +791,7 @@ class wsBase
|
|||||||
$sBody = G::replaceDataField( $templateContents, $Fields);
|
$sBody = G::replaceDataField( $templateContents, $Fields);
|
||||||
$hasEmailFrom = preg_match('/(.+)@(.+)\.(.+)/', $sFrom, $match);
|
$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'] . ">";
|
$sFrom = '"' . stripslashes($sFrom) . '" <' . $aSetup['MESS_ACCOUNT'] . ">";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -182,25 +182,29 @@ class AppNotes extends BaseAppNotes {
|
|||||||
$sFrom = '"ProcessMaker"';
|
$sFrom = '"ProcessMaker"';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($aConfiguration['MESS_ENGINE'] != 'MAIL') && ($aConfiguration['MESS_ACCOUNT'] != '')) {
|
$hasEmailFrom = preg_match('/(.+)@(.+)\.(.+)/', $sFrom, $match);
|
||||||
$sFrom .= ' <' . $aConfiguration['MESS_ACCOUNT'] . '>';
|
|
||||||
} else {
|
if (!$hasEmailFrom || strpos($sFrom, $aConfiguration['MESS_ACCOUNT']) === false) {
|
||||||
if (($aConfiguration['MESS_ENGINE'] == 'MAIL')) {
|
if (($aConfiguration['MESS_ENGINE'] != 'MAIL') && ($aConfiguration['MESS_ACCOUNT'] != '')) {
|
||||||
$sFrom .= ' <info@' . gethostbyaddr('127.0.0.1') . '>';
|
$sFrom .= ' <' . $aConfiguration['MESS_ACCOUNT'] . '>';
|
||||||
} else {
|
} else {
|
||||||
if ($aConfiguration['MESS_SERVER'] != '') {
|
if (($aConfiguration['MESS_ENGINE'] == 'MAIL')) {
|
||||||
if (($sAux = @gethostbyaddr($aConfiguration['MESS_SERVER']))) {
|
$sFrom .= ' <info@' . gethostbyaddr('127.0.0.1') . '>';
|
||||||
$sFrom .= ' <info@' . $sAux . '>';
|
|
||||||
} else {
|
|
||||||
$sFrom .= ' <info@' . $aConfiguration['MESS_SERVER'] . '>';
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
$sFrom .= ' <info@processmaker.com>';
|
if ($aConfiguration['MESS_SERVER'] != '') {
|
||||||
|
if (($sAux = @gethostbyaddr($aConfiguration['MESS_SERVER']))) {
|
||||||
|
$sFrom .= ' <info@' . $sAux . '>';
|
||||||
|
} else {
|
||||||
|
$sFrom .= ' <info@' . $aConfiguration['MESS_SERVER'] . '>';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$sFrom .= ' <info@processmaker.com>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$sSubject = G::replaceDataField($configNoteNotification['subject'], $aFields);
|
$sSubject = G::replaceDataField($configNoteNotification['subject'], $aFields);
|
||||||
|
|
||||||
|
|
||||||
//erik: new behaviour for messages
|
//erik: new behaviour for messages
|
||||||
|
|||||||
Reference in New Issue
Block a user