You are right!! Usually if you have secondary Carbon then most likely you will have E2 product as your major and SN2 as your minor product. But this is one of the exceptions, OTs is a really good leaving group since its resonance stabilized; therefore substitution occurs and NaOCH3 acts as a nucleophile..