Always display Sender and recipients in compose email view

Dear all,

Is there a clean and quick way to display the Sender and Recipients fields when composing a new mail in version 10.0.X ?

Our customer has several outbound emails configured, and the problem is that the sender is not displayed, so it can end to use the wrong outbound email address. And they do not have the reflex to click on the header to toggle the fields.

I tried to modify email-recipients, recipients-fields, compose-email, but nothing changed.

Did you ever do that ? Can you help me ? had also the same problem in that conversation : 

https://sugarclub.sugarcrm.com/dev-club/f/questions-answers/1265/complaints-about-recipients-on-emails-v8

Thanks a lot for your help !

Have a nice friday,

Enes

  • Hi everybody,

    Finally I find how to display by default the recipients. Here is how to do : 

    Extend the compose-email.js view in custom/modules/Emails/clients/base/views/compose-email/compose-email.js : 

    initialize: function(options){
        this._super('initialize',[options]);
    	this._customPrepopulate();
    
        this.on('editable:toggle_fields', function(fields, viewName) {
            var field = this.getField('recipients');
    
            if (field) {
                field.setMode('edit');
            }
        }, this);
    },

    The part interesting for us is field.setMode('edit') for the recipients fields. This will make it editable when opening the compose email view.

    We have to extend the file modules/Emails/clients/base/fields/recipients-fieldset/recipients-fieldset.js : 

    ({
        extendsFrom: 'EmailsRecipientsFieldsetField',
    
        _blur: function(event) {
            this._super('_blur', [event]);
    
            if (this.type == 'recipients-fieldset') {
                this.setMode('edit');
            }
        },
    })
    

    In the function _blur fired when clicking everywhere in the view, we set by default the edit mode everytime we are on the field recipients-fieldset.

    A quick repair and rebuild and everything is upgrade safe and working :-)

    Hope it will help a lot of them.

    Have a nice day, and stay safe.

    Enes

  • Please suggest as idea to make this core?
    Then post the idea link here and we'll all vote for itGrin

  • Hi, just to warn : the "this._customPrepopulate();" row in "compose-email.js" is a copy-paste error, to make it work don't take that row