It is the sound of the letter and not the letter itself that matter. For example we would say 'an hour' becasue the 'h' is not aspirated. In yor example the first sound is the 'e' sound so 'an' is correct.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.