Skip to content

EspoCRM – Open Source CRM Application

email address add impr

Yuri Kuznetsovc426a637feac
diff --git a/client/src/views/email/fields/email-address-varchar.js b/client/src/views/email/fields/email-address-varchar.js
index 3c8be77ecc..ba1b0a609c 100644
--- a/client/src/views/email/fields/email-address-varchar.js
+++ b/client/src/views/email/fields/email-address-varchar.js
@@ -420,7 +420,38 @@ class EmailAddressVarcharFieldView extends BaseFieldView {
return true;
}
+ /**
+ *
+ * @param {string} address
+ * @param {string} name
+ * @param {string} [type]
+ * @param {string} [id]
+ */
addAddress(address, name, type, id) {
+ if (name === '') {
+ const nameHash = this.model.attributes.nameHash ?? {};
+
+ if (address in nameHash) {
+ name = nameHash[address];
+ }
+ }
+
+ if (type === undefined) {
+ const typeHash = this.model.attributes.typeHash ?? {};
+
+ if (address in typeHash) {
+ type = typeHash[address];
+ }
+ }
+
+ if (id === undefined) {
+ const idHash = this.model.attributes.idHash ?? {};
+
+ if (address in idHash) {
+ id = idHash[address];
+ }
+ }
+
if (this.justAddedAddress) {
this.deleteAddress(this.justAddedAddress);
}