Trying to surface whether the email list displayed in Contacts List view has opted out or not. Over in the Admin studio I can add āemail_opt_outā as a column but its return a blank disabled checkbox regardless of opt-out value for the contact, any ideas how I can do this? Feels like a bunch of fields available in detail view arenāt available in list view?
This is the opt-out, not the opt-in ticks - weāre looking to make the opt-out a lot more clearer when its been ticked/enabled to our users and even perhaps obscure email addresses in lists. Iāve been messing about with adapting the contact list via a logic hook but that field seems empty. Iām new to SuiteCRM so probably something I need to understand about how those fields work.
Sorry to be clearer, the opt-out merely shows nothing, no icon. I think when opt-in is awaiting some confirmation itāll show a grey tick. Nothing seems directly related to the opt-out field.
Funnily enough thatās the exact link iāve been playing with the last few hours. Iāve even tried returning print_r($bean) to see whats in there but the email_optout field is blank. Is that field representing the primary email1 fieldās opt-out tick box?
Curious how the email gets displayed via that bean also, is it a subquery? perhaps thatās why the opt-out isnāt behaving as expected, as related to that field.
If can then loop through all addresses for that Contact bean, decided whether to act on any email being opted out, or only if primary, a few options. Iām unsure if this is incredibly inefficient as a subquery once loading a large table of contacts or is normal practice in SuiteCRM. My last issue is I still canāt see where the email address link is being constructed, I canāt inject anything from that hook into that column in the list? Presumably this happens else where perhaps a different hook.
Thatās the thing though - I can find the fields but in the Contact bean in list view email is blank, as is opt-out. In the metadata the email is defined as:
Presumably this returns the email address formatted with A tags and opt-in ticks etc. Feels like that isnāt returned in the bean itself but more like a subquery or method either before or after where Iām trying to write the hook.I guess thatās where I want to be changing behaviour but canāt work out where ācustomCodeā => ā{$EMAIL1_LINK}ā actually goes to process.
I donāt know, Iām not that familiar with SuiteCRM code customization myselfā¦
I know that you can have fields marked in the vardefs like this
'source' => 'non-db',
which are ācalculated fieldsā that you use in the view, but donāt exist in the database. So you could use a new non-db field to show whatever you want (with your formatting, and the email address you got from the loop). Then you would leave the real email field hidden.
Iād still like to work out how to gracefully fall back to that EMAIL_LINK in the metadata though. I shall keep digging. Learned a lot already last 24 hours!