From email address sort

Does anyone know if there is a way to sort the “from” email addresses when composing an email. Obviously, I’d like my personal email to come first rather than the system and support emails.

email address list

You ask about the most obscure, most needlessly complex bit of code I know in the SuiteCRM codebase.

When that screen finishes loading, there is a JS “On load” event which calls Ajax getFromFields
in modules/Emails/EmailsController.php

which calls handleActionGetFromFields
in modules/Emails/EmailsControllerActionGetFromFields.php

This builds the “From” view from the whole complex obscure EmailsDataAddressCollector bullshit. I absolutely advise you not to go down that rabbit-hole.

But maybe at the level of handleActionGetFromFields you can just tweak the order of the array in the end, right before returning the results.

Thanks @pgr OK warning taken, It’s just an annoyance every time I create an email I have to select my own email address! Grrr. I’ll live with it. Doesn’t sound like it’s worth the frustration to customize.