email status not updated to Read when email is opened

I am still on 11.x Professional (Yes, planning to convert/upgrade as soon as I humanly can)


I am not sure when exactly this happened, but it used to be that when opening an email from the emails subpanel on Cases (clicking on the name to go to Emails record view) the email's status would change from Unread to Read. This is no longer happening. 

Is anyone else seeing the same thing?

FrancescaS

Parents
  • Hello ,

    Here is the solution for your problem.

    Create the file custom/modules/Emails/clients/base/views/record/record.js and add the following code : 

    ({
    	extendsFrom : "RecordView",
    
    	initialize: function (options) {
    	    this._super('initialize', [options]);
    
    		this.model.on("change:status", this._changeEmailStatusIfNeeded, this);
    
    		app.events.on('app:view:change', function(data) {
    			this.model.fetch();
    		}, this);
    	},
    
        _changeEmailStatusIfNeeded: function(){
        	if(this.model.previous("status") == null && this.model.get("status") == "unread"){ // in order to let the user change status back to unread if they want to
        		this.model.set("status", "read");
        		this.model.save();
        	}
        }
    })

    The change happened on V8 or V9, I don't remember. 

    Hope this would help you :-)

    Best regards,

    Enes

Reply
  • Hello ,

    Here is the solution for your problem.

    Create the file custom/modules/Emails/clients/base/views/record/record.js and add the following code : 

    ({
    	extendsFrom : "RecordView",
    
    	initialize: function (options) {
    	    this._super('initialize', [options]);
    
    		this.model.on("change:status", this._changeEmailStatusIfNeeded, this);
    
    		app.events.on('app:view:change', function(data) {
    			this.model.fetch();
    		}, this);
    	},
    
        _changeEmailStatusIfNeeded: function(){
        	if(this.model.previous("status") == null && this.model.get("status") == "unread"){ // in order to let the user change status back to unread if they want to
        		this.model.set("status", "read");
        		this.model.save();
        	}
        }
    })

    The change happened on V8 or V9, I don't remember. 

    Hope this would help you :-)

    Best regards,

    Enes

Children