Ensure methods on `IncomingEmail` are available on `ServiceDeskEmail`
A missing class method on ServiceDeskEmail that was expected resulted in NoMethodError: undefined method `key_from_fallb... (#364118 - closed) with the user experience of emails silently lost.
ServiceDeskEmail is substituted for IncomingEmail when an email is being ingested using the Service Desk custom mailbox workflow.
Methods on IncomingEmail that are called in this workflow need to be available on both classes.
There are two ways to do this, both are fine:
- Common methods in
IncomingEmailandServiceDeskEmailare implemented on a superclass and only included in each subclass if they deviate from the default implementation, - Implement an
Emailinterface and include it in each class. The interface implements all expected methods but raisesNotImplementedErrorin each, enforcing that each is implemented in every*Emailclass.
Edited by John Hope