Extending email service/entity

Hi guys,

Is there a method to extend the email service/entity? Quite new to all this.

What I have is ‘Accounts’ which have an email address. When I go into the edit screen for the account I want to be able to list all the emails that have been sent to that account. The account could have it’s email address change at any time so I think I would need to extend the Email entity (whatever it is) and add the account to it. However, I can’t seem to find the email entity. I did manage to do something similar to the fileDescriptor however.

Is there a guide on how to do this? I presume it’s a pretty common requirement to be able to see emails by Account etc.

Hi Daryn,

The entity representing emails sent is com.haulmont.cuba.core.entity.SendingMessage. You should be able to extend it and add the reference to your entity. SendingMessage instances are created in the convertToSendingMessage() method of the Emailer bean, so you should extend this bean and override this method to associate SendingMessage instances with your entity, probably by looking it up by email.