Question

Click to Email

Hello all, I have a custom field with a secondary Email. On the Contact Card the Email is a mailto: link and when you click on it it takes you to a new email screen in Creatio. I made my custom field a mailto: link, but when I click it it just opens a new browser window.

 

Any idea on how to accomplish this?

 

Thank you

Like 0

Like

8 comments

Keith Schmitt

 

Your diff array should look like this,

diff: /**SCHEMA_DIFF*/[
			{
				"operation": "insert",
				"name": "STRING64b351cf-a588-4d3f-a86b-f226713bc680",
				"values": {
					"layout": {
						"colSpan": 24,
						"rowSpan": 1,
						"column": 0,
						"row": 6,
						"layoutName": "ProfileContainer"
					},
					"bindTo": "UsrSecondaryEmail",
					"enabled": true,
					"showValueAsLink": true,
					"href": {
						"bindTo": "UsrSecondaryEmail",
						"bindConfig": {converter: "getLinkValue"}
					},
					"linkclick": {
						"bindTo": "sendEmail"
					},
					"controlConfig": {
						"autocomplete": Terrasoft.generateGUID(),
					}
				},
				"parentName": "ProfileContainer",
				"propertyName": "items",
				"index": 6
			},
]/**SCHEMA_DIFF*/

If you have added the field on a different object other than Contact, the you need to add  "CommunicationOptionsMixin" mixin as a dependency,

define("UsrObjectPage", ["CommunicationOptionsMixin"], function() {
	return {
		entitySchemaName: "UsrObject",
		attributes: {},
		mixins: {
			CommunicationOptionsMixin: "Terrasoft.CommunicationOptionsMixin"
		},
		modules: /**SCHEMA_MODULES*/{}/**SCHEMA_MODULES*/,
		details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
		businessRules: /**SCHEMA_BUSINESS_RULES*/{}/**SCHEMA_BUSINESS_RULES*/,
		methods: {},
		dataModels: /**SCHEMA_DATA_MODELS*/{}/**SCHEMA_DATA_MODELS*/,
		diff: /**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/
	};
});

Regards,

Sourav Kumar Samal

Thank you so much for the help!! I have added this to the lead section, but it just spawns a new Browser window. This message is in the console

"Launched external handler for 'mailto:test1234@gmail.com'"

 

I did add the mixins. 

 

mixins: {
			MiniPageUtilitiesMixin: "Terrasoft.MiniPageUtilities",	
			CommunicationOptionsMixin: "Terrasoft.CommunicationOptionsMixin"
		},	

 

and The Field

 

{
				"operation": "insert",
				"name": "STRING37b063cf-4e73-4f45-901a-59a78989c53f",
				"values": {
					"layout": {
						"colSpan": 12,
						"rowSpan": 1,
						"column": 12,
						"row": 4,
						"layoutName": "LeadPageRegisterInfoBlock"
					},
					"bindTo": "Usremail2",
					"enabled": true,
					"showValueAsLink": true,
					"href": {
						"bindTo": "Usremail2",
						"bindConfig": {
							"converter": "getLinkValue"
						}
					},
					"linkclick": {
						"bindTo": "sendEmail"
					},
					"controlConfig": {
						"autocomplete": Terrasoft.generateGUID(),
					}
				},
				"parentName": "LeadPageRegisterInfoBlock",
				"propertyName": "items",
				"index": 13
			},

Not sure what is going on. No Errors in the console.

keith schmitt,

 

Try to click "mailto:test1234@gmail.com".

 

If this opens in your email client then above code should work, as I have tried the exact same code on a different custom object and it worked. If it doesn't work, try checking your browser handler settings or open in a different browser and try.

 

If you are using chrome, refer the below link,

https://support.google.com/a/users/answer/9308783?hl=en

 

Regards,

Sourav

 

I can get it to open in an external Client no Problem. I am trying to get it to open in Creatio to create a new Email Like on the contact card. If I am on the contact. In the Contact Card section and I click the Email address, it goes to create a new Email in Creatio. Not an external App. 

 

Thank you

keith schmitt,

 

Now that you have highlighted, I am also observing that with the same configuration as above, in some environments it is redirecting to Creatio email page and in some environments it is redirecting to External application. Not sure ehat is causing this.

 

Regards,

Sourav

So in the Contact section, the link will work if you have a Linked Email account in Creatio. Will user Browser default action if you do not.  Not sure why it still not work in Leads. This is handled  by the EmailLinksMixin. 

keith schmitt,

Hi Keith, if you add this to the page it will work:

init: function() {
	this.callParent(arguments);
	this.initSyncMailboxCount();
}

The reason it isn't working is the code checks for an attribute on the page that is a count of the mailboxes set up for the current user. It's not getting initialized on the Lead page. Once you add the above it should work. 

Ryan

YESS!!  That was it. Thank you very Much!!!

Show all comments