[emails] Add getByMessageId method. Add test for getByMessageId and getThread