varchar trim and system emails
This commit is contained in:
@@ -102,11 +102,15 @@ class Importer
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (isset($message->messageId) && !empty($message->messageId)) {
|
||||
$email->set('messageId', $message->messageId);
|
||||
if (isset($message->deliveredTo)) {
|
||||
$email->set('messageIdInternal', $message->messageId . '-' . $message->deliveredTo);
|
||||
}
|
||||
if (stripos($message->messageId, '@espo-system') !== false) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if ($duplicate = $this->findDuplicate($email)) {
|
||||
|
||||
@@ -321,6 +321,9 @@ class Sender
|
||||
} else {
|
||||
$messageId = '' . md5($email->get('name')) . '/' . time() . '/' . $rand . '@espo';
|
||||
}
|
||||
if ($email->get('isSystem')) {
|
||||
$messageId .= '-system';
|
||||
}
|
||||
|
||||
$messageIdHeader = new \Zend\Mail\Header\MessageId();
|
||||
$messageIdHeader->setId($messageId);
|
||||
|
||||
@@ -116,7 +116,8 @@
|
||||
"seeMoreDisabled": "Disable Text Cut",
|
||||
"entityList": "Entity List",
|
||||
"isSorted": "Is Sorted (alphabetically)",
|
||||
"audited": "Audited"
|
||||
"audited": "Audited",
|
||||
"trim": "Trim"
|
||||
},
|
||||
"messages": {
|
||||
"upgradeVersion": "Your EspoCRM will be upgraded to version <strong>{version}</strong>. This can take some time.",
|
||||
|
||||
@@ -172,6 +172,11 @@
|
||||
"type": "linkMultiple",
|
||||
"readOnly": true
|
||||
},
|
||||
"isSystem": {
|
||||
"type": "bool",
|
||||
"default": false,
|
||||
"readOnly": true
|
||||
},
|
||||
"teams": {
|
||||
"type": "linkMultiple"
|
||||
},
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"type": "varchar",
|
||||
"required": true,
|
||||
"maxLength": 100,
|
||||
"trim": true,
|
||||
"view": "EmailAccount.Fields.EmailAddress"
|
||||
},
|
||||
"status": {
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
"type": "varchar",
|
||||
"required": true,
|
||||
"maxLength": 100,
|
||||
"view": "EmailAccount.Fields.EmailAddress"
|
||||
"view": "EmailAccount.Fields.EmailAddress",
|
||||
"trim": true
|
||||
},
|
||||
"status": {
|
||||
"type": "enum",
|
||||
|
||||
@@ -84,7 +84,8 @@
|
||||
"outboundEmailFromAddress": {
|
||||
"type": "varchar",
|
||||
"default": "crm@example.com",
|
||||
"required": true
|
||||
"required": true,
|
||||
"trim": true
|
||||
},
|
||||
"smtpServer": {
|
||||
"type": "varchar",
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
"name":"maxLength",
|
||||
"type":"int"
|
||||
},
|
||||
{
|
||||
"name":"trim",
|
||||
"type":"bool"
|
||||
},
|
||||
{
|
||||
"name":"audited",
|
||||
"type":"bool"
|
||||
|
||||
@@ -105,7 +105,8 @@ class EmailNotification extends \Espo\Core\Services\Base
|
||||
'subject' => $subject,
|
||||
'body' => $body,
|
||||
'isHtml' => false,
|
||||
'to' => $emailAddress
|
||||
'to' => $emailAddress,
|
||||
'isSystem' => true
|
||||
));
|
||||
|
||||
$this->getMailSender()->send($email);
|
||||
|
||||
@@ -31,8 +31,23 @@ Espo.define('Views.Fields.Varchar', 'Views.Fields.Base', function (Dep) {
|
||||
this.searchParams.typeOptions = ['startsWith', 'contains', 'equals'];
|
||||
},
|
||||
|
||||
fetch: function () {
|
||||
var data = {};
|
||||
var value = this.$element.val();
|
||||
if (this.params.trim) {
|
||||
if (typeof value.trim === 'function') {
|
||||
value = value.trim();
|
||||
}
|
||||
}
|
||||
data[this.name] = value;
|
||||
return data;
|
||||
},
|
||||
|
||||
fetchSearch: function () {
|
||||
var value = this.$element.val();
|
||||
if (typeof value.trim === 'function') {
|
||||
value = value.trim();
|
||||
}
|
||||
var type = this.$el.find('[name="'+this.name+'-type"]').val() || 'startsWith';
|
||||
if (value) {
|
||||
var data = {
|
||||
|
||||
Reference in New Issue
Block a user