Send loan expired emails after database updates

See #274