I created 2 custom email address fields in the Accounts moduleâs DetailView using the custom code below. Problem is that clicking an email address doesnât open SuiteCRMâs Emails module but instead wants to open Windows 10 Mail; yet the default builtin Email1 field is clickable and opens the Emails module, allowing the use of custom email templates. How can I get the two custom email addresses to be clickable and open the Emails module? Thanks in advance
Custom Code used in Custom\modules\Accounts\metadata\detailviewdefs.php
0 =>
array (
ânameâ => âacctemail2_câ,
âlabelâ => âLBL_ACCTEMAIL2â,
custom Code => <a href="mail to : {$fields .acctemail2_c. value} >{$fields .acctemail2_c .value}',
Purposely left out â and " in the cust code so I could post this msg
Also performed QR&R twice
I make the change and after a QR&R, when clicking on an account name, the result is a blank screen with the top menu options available (Accounts, Sales. Marketing, Support, Activities, Collaboration, Accounts & All).
Iâve attached a copy of the 3 PHP files instead of copying the code - this is the coding that opens Windows 10 Mail instead of the Email moduleâs Composed Email View.
Itâs possible that the code you provided didnât appear properly as well.
Tried the updated code though it doesnât open the popup window âCompose EMailâ with options to:
select an email template
Related To selection (ie Accounts) with a bxo to the right to select the actual account
From dropdown list to select the from email address (ie userâs local email account)
To box
CC & BCC text boxes
Subject textbox
Instead it replaced the Account info screen with a screen that shows:
Save
Cancel
Related to dropdown box with a box to right to select the account
Category
followed by Save and Cancel buttons.
Iâd like to click on the email link and have a popup âCompose Emailâ windows which leaves the original Account Details screen in the background.
I notice the code provided by @Zxcvvbk links to an Edit view in the Emails module. But there is a specific view for Compose called (appropriately) ComposeView.
Well, weâre almost there. The custom code now replaces the DetailView screen with the Compose Email screen with the ability to select a template. Problem is that it doesnât populate the Related To: field {should be âAccountsâ} and the Account from which an email is to be sent. It also doesnât populate the To: {email address field}. If I cancel from the Compose Email screen, I get the following error even though I clearly have access to that Account:
Error retrieving record. This record may be deleted or you may not be authorized to view it.
The text field ACCTEMAIL1 contains an email address which is clickable.
What Iâd like is when clicking on the field Email1 entry that contains an email address, the Account Detail screen remains in the background and a popup windows âCompose Emailâ appears in the foreground as follows:
Email Template: {is blank from which I can select the Email Template to use}
Related To field shows âAccountâ with a Empty text box to select the Account
To: {email address clicked in the Account Detail screen}
So my question is how can I accomplish clicking on the AcctEmail1 email address that pops up a Compose Email screen in the foreground with the populated To: email address identical to the process when clicking on the email address in the Email1 entry?
I went to accounts, opened browser dev tools, network tab, and clicked âcompose emailâ in the activities subpanel. This is the URL itâs building:
I tried your code as per below but instead the email address showed up as a blank entry that was clickable but nothing happened. I could double click the field to edit & it had the email address.
I donât know, maybe some detail is missing. I would try it first with a static URL, without any variables, just directly use static ids, until you can get it working. Then, after that problem is solved, you can try solving the next problem, which is the generation of the dynamic URL.