If you remove a custom entity that is email enabled (allowing it to be selected as email recipient), you may run into the following issue after the entity is removed.
When going to an account and selecting the “Activity” tab of the activity/social pane, the following error appears
The trace log will reveal an error referencing the OTC of the entity that was deleted. The problem is that when the entity is removed, activities remain in the system that have activity parties associated with records from the now deleted entity. When the activity pane renders for an account, if there are any activities regarding that account that have activity parties from the deleted entity, the activity pane will throw an error. The solution is to delete all activity party records where the OTC of the partyid equals the OTC of the deleted entity.
Thanks to Scott Jung for this tip.